Skip to content

Commit b9885f7

Browse files
committed
PATCH: add missing behaviors in naming constraint (#1046)
* add missing behaviors in naming constraint * respond 200 wiht conflicting document on NamingConstraint destroy * add explaination to avoid bloc loop * use transaction, simply views
1 parent a44101b commit b9885f7

23 files changed

Lines changed: 184 additions & 164 deletions

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
144144
projects_pk = 1 # int | A unique integer value identifying this project.
145145
topics_guid = "topics_guid_example" # str |
146146
comment_request = CommentRequest(
147-
date=dateutil_parser('1970-01-01T00:00:00.00Z'),
148147
viewpoint_guid="viewpoint_guid_example",
148+
modified_author="modified_author_example",
149+
viewpoint_temp_id=1,
150+
date=dateutil_parser('1970-01-01T00:00:00.00Z'),
151+
author="author_example",
149152
reply_to_comment_guid="reply_to_comment_guid_example",
150153
comment="comment_example",
151-
author="author_example",
152-
viewpoint_temp_id=1,
153-
modified_author="modified_author_example",
154154
guid="guid_example",
155155
) # CommentRequest | (optional)
156156

bimdata_api_client/api/collaboration_api.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,7 +2639,7 @@ def __init__(self, api_client=None):
26392639
)
26402640
self.delete_naming_constraint_endpoint = _Endpoint(
26412641
settings={
2642-
'response_type': None,
2642+
'response_type': ([LightDocument],),
26432643
'auth': [
26442644
'ApiKey',
26452645
'BIMData_Connect',
@@ -2696,7 +2696,9 @@ def __init__(self, api_client=None):
26962696
}
26972697
},
26982698
headers_map={
2699-
'accept': [],
2699+
'accept': [
2700+
'application/json'
2701+
],
27002702
'content_type': [],
27012703
},
27022704
api_client=api_client
@@ -10237,7 +10239,7 @@ def create_document(
1023710239
):
1023810240
"""Create a document # noqa: E501
1023910241

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

@@ -12056,7 +12058,7 @@ def delete_naming_constraint(
1205612058
):
1205712059
"""Delete a naming constraint # noqa: E501
1205812060

12059-
Delete a naming constraint Required scopes: document:write # noqa: E501
12061+
Delete a naming constraint. Responds with 200 OK and a list of documents that are now in conflict if the constraint is strict and some documents don't match the updated rule. Required scopes: document:write # noqa: E501
1206012062
This method makes a synchronous HTTP request by default. To make an
1206112063
asynchronous HTTP request, please pass async_req=True
1206212064

@@ -12097,7 +12099,7 @@ def delete_naming_constraint(
1209712099
async_req (bool): execute request asynchronously
1209812100

1209912101
Returns:
12100-
None
12102+
[LightDocument]
1210112103
If the method is called asynchronously, returns the request
1210212104
thread.
1210312105
"""

bimdata_api_client/model/comment.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ class Comment(ModelNormal):
5959
}
6060

6161
validations = {
62-
('author',): {
62+
('modified_author',): {
6363
'max_length': 254,
6464
},
65-
('modified_author',): {
65+
('author',): {
6666
'max_length': 254,
6767
},
6868
}
@@ -90,12 +90,12 @@ def openapi_types():
9090
return {
9191
'modified_date': (datetime,), # noqa: E501
9292
'topic_guid': (str,), # noqa: E501
93-
'date': (datetime,), # noqa: E501
9493
'viewpoint_guid': (str, none_type,), # noqa: E501
94+
'modified_author': (str, none_type,), # noqa: E501
95+
'date': (datetime,), # noqa: E501
96+
'author': (str, none_type,), # noqa: E501
9597
'reply_to_comment_guid': (str, none_type,), # noqa: E501
9698
'comment': (str,), # noqa: E501
97-
'author': (str, none_type,), # noqa: E501
98-
'modified_author': (str, none_type,), # noqa: E501
9999
'guid': (str,), # noqa: E501
100100
}
101101

@@ -107,12 +107,12 @@ def discriminator():
107107
attribute_map = {
108108
'modified_date': 'modified_date', # noqa: E501
109109
'topic_guid': 'topic_guid', # noqa: E501
110-
'date': 'date', # noqa: E501
111110
'viewpoint_guid': 'viewpoint_guid', # noqa: E501
111+
'modified_author': 'modified_author', # noqa: E501
112+
'date': 'date', # noqa: E501
113+
'author': 'author', # noqa: E501
112114
'reply_to_comment_guid': 'reply_to_comment_guid', # noqa: E501
113115
'comment': 'comment', # noqa: E501
114-
'author': 'author', # noqa: E501
115-
'modified_author': 'modified_author', # noqa: E501
116116
'guid': 'guid', # noqa: E501
117117
}
118118

@@ -163,12 +163,12 @@ def _from_openapi_data(cls, modified_date, topic_guid, *args, **kwargs): # noqa
163163
Animal class but this time we won't travel
164164
through its discriminator because we passed in
165165
_visited_composed_classes = (Animal,)
166-
date (datetime): [optional] # noqa: E501
167166
viewpoint_guid (str, none_type): [optional] # noqa: E501
167+
modified_author (str, none_type): [optional] # noqa: E501
168+
date (datetime): [optional] # noqa: E501
169+
author (str, none_type): [optional] # noqa: E501
168170
reply_to_comment_guid (str, none_type): [optional] # noqa: E501
169171
comment (str): [optional] # noqa: E501
170-
author (str, none_type): [optional] # noqa: E501
171-
modified_author (str, none_type): [optional] # noqa: E501
172172
guid (str): [optional] # noqa: E501
173173
"""
174174

@@ -253,12 +253,12 @@ def __init__(self, *args, **kwargs): # noqa: E501
253253
Animal class but this time we won't travel
254254
through its discriminator because we passed in
255255
_visited_composed_classes = (Animal,)
256-
date (datetime): [optional] # noqa: E501
257256
viewpoint_guid (str, none_type): [optional] # noqa: E501
257+
modified_author (str, none_type): [optional] # noqa: E501
258+
date (datetime): [optional] # noqa: E501
259+
author (str, none_type): [optional] # noqa: E501
258260
reply_to_comment_guid (str, none_type): [optional] # noqa: E501
259261
comment (str): [optional] # noqa: E501
260-
author (str, none_type): [optional] # noqa: E501
261-
modified_author (str, none_type): [optional] # noqa: E501
262262
guid (str): [optional] # noqa: E501
263263
"""
264264

bimdata_api_client/model/comment_request.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ class CommentRequest(ModelNormal):
5959
}
6060

6161
validations = {
62-
('author',): {
62+
('modified_author',): {
6363
'max_length': 254,
6464
},
65-
('modified_author',): {
65+
('author',): {
6666
'max_length': 254,
6767
},
6868
}
@@ -88,13 +88,13 @@ def openapi_types():
8888
and the value is attribute type.
8989
"""
9090
return {
91-
'date': (datetime,), # noqa: E501
9291
'viewpoint_guid': (str, none_type,), # noqa: E501
92+
'modified_author': (str, none_type,), # noqa: E501
93+
'viewpoint_temp_id': (int,), # noqa: E501
94+
'date': (datetime,), # noqa: E501
95+
'author': (str, none_type,), # noqa: E501
9396
'reply_to_comment_guid': (str, none_type,), # noqa: E501
9497
'comment': (str,), # noqa: E501
95-
'author': (str, none_type,), # noqa: E501
96-
'viewpoint_temp_id': (int,), # noqa: E501
97-
'modified_author': (str, none_type,), # noqa: E501
9898
'guid': (str,), # noqa: E501
9999
}
100100

@@ -104,13 +104,13 @@ def discriminator():
104104

105105

106106
attribute_map = {
107-
'date': 'date', # noqa: E501
108107
'viewpoint_guid': 'viewpoint_guid', # noqa: E501
108+
'modified_author': 'modified_author', # noqa: E501
109+
'viewpoint_temp_id': 'viewpoint_temp_id', # noqa: E501
110+
'date': 'date', # noqa: E501
111+
'author': 'author', # noqa: E501
109112
'reply_to_comment_guid': 'reply_to_comment_guid', # noqa: E501
110113
'comment': 'comment', # noqa: E501
111-
'author': 'author', # noqa: E501
112-
'viewpoint_temp_id': 'viewpoint_temp_id', # noqa: E501
113-
'modified_author': 'modified_author', # noqa: E501
114114
'guid': 'guid', # noqa: E501
115115
}
116116

@@ -155,13 +155,13 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
155155
Animal class but this time we won't travel
156156
through its discriminator because we passed in
157157
_visited_composed_classes = (Animal,)
158-
date (datetime): [optional] # noqa: E501
159158
viewpoint_guid (str, none_type): [optional] # noqa: E501
159+
modified_author (str, none_type): [optional] # noqa: E501
160+
viewpoint_temp_id (int): Only used when using POST on the full-topic route to bind viewpoint with comment. [optional] # noqa: E501
161+
date (datetime): [optional] # noqa: E501
162+
author (str, none_type): [optional] # noqa: E501
160163
reply_to_comment_guid (str, none_type): [optional] # noqa: E501
161164
comment (str): [optional] # noqa: E501
162-
author (str, none_type): [optional] # noqa: E501
163-
viewpoint_temp_id (int): Only used when using POST on the full-topic route to bind viewpoint with comment. [optional] # noqa: E501
164-
modified_author (str, none_type): [optional] # noqa: E501
165165
guid (str): [optional] # noqa: E501
166166
"""
167167

@@ -244,13 +244,13 @@ def __init__(self, *args, **kwargs): # noqa: E501
244244
Animal class but this time we won't travel
245245
through its discriminator because we passed in
246246
_visited_composed_classes = (Animal,)
247-
date (datetime): [optional] # noqa: E501
248247
viewpoint_guid (str, none_type): [optional] # noqa: E501
248+
modified_author (str, none_type): [optional] # noqa: E501
249+
viewpoint_temp_id (int): Only used when using POST on the full-topic route to bind viewpoint with comment. [optional] # noqa: E501
250+
date (datetime): [optional] # noqa: E501
251+
author (str, none_type): [optional] # noqa: E501
249252
reply_to_comment_guid (str, none_type): [optional] # noqa: E501
250253
comment (str): [optional] # noqa: E501
251-
author (str, none_type): [optional] # noqa: E501
252-
viewpoint_temp_id (int): Only used when using POST on the full-topic route to bind viewpoint with comment. [optional] # noqa: E501
253-
modified_author (str, none_type): [optional] # noqa: E501
254254
guid (str): [optional] # noqa: E501
255255
"""
256256

bimdata_api_client/model/document_text.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ class DocumentText(ModelNormal):
5959
('language',): {
6060
'None': None,
6161
'ITALIAN': "italian",
62-
'FRENCH': "french",
6362
'ENGLISH': "english",
64-
'GERMAN': "german",
63+
'FRENCH': "french",
6564
'SPANISH': "spanish",
65+
'GERMAN': "german",
6666
'NULL': "null",
6767
},
6868
}
@@ -153,7 +153,7 @@ def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501
153153
through its discriminator because we passed in
154154
_visited_composed_classes = (Animal,)
155155
text (str, none_type): The full text representation of a document if the feature is enabled and the file format supported. [optional] # noqa: E501
156-
language (str, none_type): * `italian` - italian * `french` - french * `english` - english * `german` - german * `spanish` - spanish. [optional] # noqa: E501
156+
language (str, none_type): * `italian` - italian * `english` - english * `french` - french * `spanish` - spanish * `german` - german. [optional] # noqa: E501
157157
"""
158158

159159
_check_type = kwargs.pop('_check_type', True)
@@ -237,7 +237,7 @@ def __init__(self, *args, **kwargs): # noqa: E501
237237
through its discriminator because we passed in
238238
_visited_composed_classes = (Animal,)
239239
text (str, none_type): The full text representation of a document if the feature is enabled and the file format supported. [optional] # noqa: E501
240-
language (str, none_type): * `italian` - italian * `french` - french * `english` - english * `german` - german * `spanish` - spanish. [optional] # noqa: E501
240+
language (str, none_type): * `italian` - italian * `english` - english * `french` - french * `spanish` - spanish * `german` - german. [optional] # noqa: E501
241241
"""
242242

243243
_check_type = kwargs.pop('_check_type', True)

bimdata_api_client/model/edit_folder.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ def openapi_types():
109109
"""
110110
lazy_import()
111111
return {
112-
'groups_permissions': ([GroupFolderRead],), # noqa: E501
113-
'nature': (str,), # noqa: E501
114112
'created_by': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
113+
'id': (int,), # noqa: E501
114+
'nature': (str,), # noqa: E501
115+
'created_at': (datetime,), # noqa: E501
115116
'updated_at': (datetime,), # noqa: E501
116117
'type': (str,), # noqa: E501
117-
'id': (int,), # noqa: E501
118+
'groups_permissions': ([GroupFolderRead],), # noqa: E501
118119
'name': (str,), # noqa: E501
119120
'user_permission': (int,), # noqa: E501
120-
'created_at': (datetime,), # noqa: E501
121121
'conflicting_documents': ([LightDocument],), # noqa: E501
122122
'parent_id': (int, none_type,), # noqa: E501
123123
'default_permission': (int,), # noqa: E501
@@ -129,49 +129,49 @@ def discriminator():
129129

130130

131131
attribute_map = {
132-
'groups_permissions': 'groups_permissions', # noqa: E501
133-
'nature': 'nature', # noqa: E501
134132
'created_by': 'created_by', # noqa: E501
133+
'id': 'id', # noqa: E501
134+
'nature': 'nature', # noqa: E501
135+
'created_at': 'created_at', # noqa: E501
135136
'updated_at': 'updated_at', # noqa: E501
136137
'type': 'type', # noqa: E501
137-
'id': 'id', # noqa: E501
138+
'groups_permissions': 'groups_permissions', # noqa: E501
138139
'name': 'name', # noqa: E501
139140
'user_permission': 'user_permission', # noqa: E501
140-
'created_at': 'created_at', # noqa: E501
141141
'conflicting_documents': 'conflicting_documents', # noqa: E501
142142
'parent_id': 'parent_id', # noqa: E501
143143
'default_permission': 'default_permission', # noqa: E501
144144
}
145145

146146
read_only_vars = {
147-
'groups_permissions', # noqa: E501
148-
'nature', # noqa: E501
149147
'created_by', # noqa: E501
148+
'id', # noqa: E501
149+
'nature', # noqa: E501
150+
'created_at', # noqa: E501
150151
'updated_at', # noqa: E501
151152
'type', # noqa: E501
152-
'id', # noqa: E501
153+
'groups_permissions', # noqa: E501
153154
'user_permission', # noqa: E501
154-
'created_at', # noqa: E501
155155
'conflicting_documents', # noqa: E501
156156
}
157157

158158
_composed_schemas = {}
159159

160160
@classmethod
161161
@convert_js_args_to_python_args
162-
def _from_openapi_data(cls, groups_permissions, nature, created_by, updated_at, type, id, name, user_permission, created_at, conflicting_documents, *args, **kwargs): # noqa: E501
162+
def _from_openapi_data(cls, created_by, id, nature, created_at, updated_at, type, groups_permissions, name, user_permission, conflicting_documents, *args, **kwargs): # noqa: E501
163163
"""EditFolder - a model defined in OpenAPI
164164
165165
Args:
166-
groups_permissions ([GroupFolderRead]): List of group permissions
167-
nature (str): Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files
168166
created_by (bool, date, datetime, dict, float, int, list, str, none_type):
167+
id (int):
168+
nature (str): Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files
169+
created_at (datetime): Creation date
169170
updated_at (datetime): Date of the last update
170171
type (str): DEPRECATED: Use 'nature' instead. Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files
171-
id (int):
172+
groups_permissions ([GroupFolderRead]): List of group permissions
172173
name (str): Name of the folder
173174
user_permission (int): Aggregate of group user permissions and folder default permission
174-
created_at (datetime): Creation date
175175
conflicting_documents ([LightDocument]): Return document with naming conflict. This is only set when you move a folder
176176
177177
Keyword Args:
@@ -234,15 +234,15 @@ def _from_openapi_data(cls, groups_permissions, nature, created_by, updated_at,
234234
self._configuration = _configuration
235235
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
236236

237-
self.groups_permissions = groups_permissions
238-
self.nature = nature
239237
self.created_by = created_by
238+
self.id = id
239+
self.nature = nature
240+
self.created_at = created_at
240241
self.updated_at = updated_at
241242
self.type = type
242-
self.id = id
243+
self.groups_permissions = groups_permissions
243244
self.name = name
244245
self.user_permission = user_permission
245-
self.created_at = created_at
246246
self.conflicting_documents = conflicting_documents
247247
for var_name, var_value in kwargs.items():
248248
if var_name not in self.attribute_map and \

0 commit comments

Comments
 (0)