Skip to content

Commit ef70175

Browse files
committed
PATCH: Retro-compatibility: use FosUser id in UC serializer, like FosUser. (#935)
* Retro-compatibility: use FosUser id in UC serializer, like FosUser. * Fix migration
1 parent ef03805 commit ef70175

File tree

10 files changed

+51
-58
lines changed

10 files changed

+51
-58
lines changed

bimdata_api_client/api/collaboration_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8881,7 +8881,7 @@ def create_document(
88818881
):
88828882
"""Create a document # noqa: E501
88838883

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

bimdata_api_client/model/document_text.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ class DocumentText(ModelNormal):
5858
allowed_values = {
5959
('language',): {
6060
'None': None,
61-
'GERMAN': "german",
62-
'FRENCH': "french",
63-
'SPANISH': "spanish",
6461
'ENGLISH': "english",
62+
'SPANISH': "spanish",
63+
'GERMAN': "german",
6564
'ITALIAN': "italian",
65+
'FRENCH': "french",
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): * `german` - german * `french` - french * `spanish` - spanish * `english` - english * `italian` - italian. [optional] # noqa: E501
156+
language (str, none_type): * `english` - english * `spanish` - spanish * `german` - german * `italian` - italian * `french` - french. [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): * `german` - german * `french` - french * `spanish` - spanish * `english` - english * `italian` - italian. [optional] # noqa: E501
240+
language (str, none_type): * `english` - english * `spanish` - spanish * `german` - german * `italian` - italian * `french` - french. [optional] # noqa: E501
241241
"""
242242

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

bimdata_api_client/model/patched_document_text_request.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ class PatchedDocumentTextRequest(ModelNormal):
5858
allowed_values = {
5959
('language',): {
6060
'None': None,
61-
'GERMAN': "german",
62-
'FRENCH': "french",
63-
'SPANISH': "spanish",
6461
'ENGLISH': "english",
62+
'SPANISH': "spanish",
63+
'GERMAN': "german",
6564
'ITALIAN': "italian",
65+
'FRENCH': "french",
6666
'NULL': "null",
6767
},
6868
}
@@ -147,7 +147,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
147147
through its discriminator because we passed in
148148
_visited_composed_classes = (Animal,)
149149
text (str, none_type): The full text representation of a document if the feature is enabled and the file format supported. [optional] # noqa: E501
150-
language (str, none_type): * `german` - german * `french` - french * `spanish` - spanish * `english` - english * `italian` - italian. [optional] # noqa: E501
150+
language (str, none_type): * `english` - english * `spanish` - spanish * `german` - german * `italian` - italian * `french` - french. [optional] # noqa: E501
151151
"""
152152

153153
_check_type = kwargs.pop('_check_type', True)
@@ -230,7 +230,7 @@ def __init__(self, *args, **kwargs): # noqa: E501
230230
through its discriminator because we passed in
231231
_visited_composed_classes = (Animal,)
232232
text (str, none_type): The full text representation of a document if the feature is enabled and the file format supported. [optional] # noqa: E501
233-
language (str, none_type): * `german` - german * `french` - french * `spanish` - spanish * `english` - english * `italian` - italian. [optional] # noqa: E501
233+
language (str, none_type): * `english` - english * `spanish` - spanish * `german` - german * `italian` - italian * `french` - french. [optional] # noqa: E501
234234
"""
235235

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

bimdata_api_client/model/user_cloud.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ def openapi_types():
8686
and the value is attribute type.
8787
"""
8888
return {
89-
'id': (int,), # noqa: E501
90-
'user_id': (int, none_type,), # noqa: E501
89+
'id': (int, none_type,), # noqa: E501
9190
'email': (str,), # noqa: E501
9291
'firstname': (str, none_type,), # noqa: E501
9392
'lastname': (str, none_type,), # noqa: E501
@@ -107,7 +106,6 @@ def discriminator():
107106

108107
attribute_map = {
109108
'id': 'id', # noqa: E501
110-
'user_id': 'user_id', # noqa: E501
111109
'email': 'email', # noqa: E501
112110
'firstname': 'firstname', # noqa: E501
113111
'lastname': 'lastname', # noqa: E501
@@ -122,7 +120,6 @@ def discriminator():
122120

123121
read_only_vars = {
124122
'id', # noqa: E501
125-
'user_id', # noqa: E501
126123
'email', # noqa: E501
127124
'firstname', # noqa: E501
128125
'lastname', # noqa: E501
@@ -139,12 +136,11 @@ def discriminator():
139136

140137
@classmethod
141138
@convert_js_args_to_python_args
142-
def _from_openapi_data(cls, id, user_id, email, firstname, lastname, profile_picture, sub, created_at, updated_at, provider, cloud_role, in_all_projects, *args, **kwargs): # noqa: E501
139+
def _from_openapi_data(cls, id, email, firstname, lastname, profile_picture, sub, created_at, updated_at, provider, cloud_role, in_all_projects, *args, **kwargs): # noqa: E501
143140
"""UserCloud - a model defined in OpenAPI
144141
145142
Args:
146-
id (int):
147-
user_id (int, none_type):
143+
id (int, none_type):
148144
email (str):
149145
firstname (str, none_type):
150146
lastname (str, none_type):
@@ -215,7 +211,6 @@ def _from_openapi_data(cls, id, user_id, email, firstname, lastname, profile_pic
215211
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
216212

217213
self.id = id
218-
self.user_id = user_id
219214
self.email = email
220215
self.firstname = firstname
221216
self.lastname = lastname

bimdata_api_client/model/write_folder.py

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ def openapi_types():
107107
"""
108108
lazy_import()
109109
return {
110+
'created_by': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
111+
'nature': (str,), # noqa: E501
112+
'id': (int,), # noqa: E501
110113
'type': (str,), # noqa: E501
111-
'updated_at': (datetime,), # noqa: E501
112114
'created_at': (datetime,), # noqa: E501
115+
'updated_at': (datetime,), # noqa: E501
113116
'groups_permissions': ([GroupFolderRead],), # noqa: E501
114-
'user_permission': (int,), # noqa: E501
115-
'created_by': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
116-
'id': (int,), # noqa: E501
117-
'nature': (str,), # noqa: E501
118117
'name': (str,), # noqa: E501
118+
'user_permission': (int,), # noqa: E501
119119
'parent_id': (int, none_type,), # noqa: E501
120120
'default_permission': (int,), # noqa: E501
121121
'children': ([WriteFolder], none_type,), # noqa: E501
@@ -127,48 +127,48 @@ def discriminator():
127127

128128

129129
attribute_map = {
130+
'created_by': 'created_by', # noqa: E501
131+
'nature': 'nature', # noqa: E501
132+
'id': 'id', # noqa: E501
130133
'type': 'type', # noqa: E501
131-
'updated_at': 'updated_at', # noqa: E501
132134
'created_at': 'created_at', # noqa: E501
135+
'updated_at': 'updated_at', # noqa: E501
133136
'groups_permissions': 'groups_permissions', # noqa: E501
134-
'user_permission': 'user_permission', # noqa: E501
135-
'created_by': 'created_by', # noqa: E501
136-
'id': 'id', # noqa: E501
137-
'nature': 'nature', # noqa: E501
138137
'name': 'name', # noqa: E501
138+
'user_permission': 'user_permission', # noqa: E501
139139
'parent_id': 'parent_id', # noqa: E501
140140
'default_permission': 'default_permission', # noqa: E501
141141
'children': 'children', # noqa: E501
142142
}
143143

144144
read_only_vars = {
145+
'created_by', # noqa: E501
146+
'nature', # noqa: E501
147+
'id', # noqa: E501
145148
'type', # noqa: E501
146-
'updated_at', # noqa: E501
147149
'created_at', # noqa: E501
150+
'updated_at', # noqa: E501
148151
'groups_permissions', # noqa: E501
149152
'user_permission', # noqa: E501
150-
'created_by', # noqa: E501
151-
'id', # noqa: E501
152-
'nature', # noqa: E501
153153
}
154154

155155
_composed_schemas = {}
156156

157157
@classmethod
158158
@convert_js_args_to_python_args
159-
def _from_openapi_data(cls, type, updated_at, created_at, groups_permissions, user_permission, created_by, id, nature, name, *args, **kwargs): # noqa: E501
159+
def _from_openapi_data(cls, created_by, nature, id, type, created_at, updated_at, groups_permissions, name, user_permission, *args, **kwargs): # noqa: E501
160160
"""WriteFolder - a model defined in OpenAPI
161161
162162
Args:
163+
created_by (bool, date, datetime, dict, float, int, list, str, none_type):
164+
nature (str): Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files
165+
id (int):
163166
type (str): DEPRECATED: Use 'nature' instead. Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files
164-
updated_at (datetime): Date of the last update
165167
created_at (datetime): Creation date
168+
updated_at (datetime): Date of the last update
166169
groups_permissions ([GroupFolderRead]): List of group permissions
167-
user_permission (int): Aggregate of group user permissions and folder default permission
168-
created_by (bool, date, datetime, dict, float, int, list, str, none_type):
169-
id (int):
170-
nature (str): Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files
171170
name (str): Name of the folder
171+
user_permission (int): Aggregate of group user permissions and folder default permission
172172
173173
Keyword Args:
174174
_check_type (bool): if True, values for parameters in openapi_types
@@ -231,15 +231,15 @@ def _from_openapi_data(cls, type, updated_at, created_at, groups_permissions, us
231231
self._configuration = _configuration
232232
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
233233

234+
self.created_by = created_by
235+
self.nature = nature
236+
self.id = id
234237
self.type = type
235-
self.updated_at = updated_at
236238
self.created_at = created_at
239+
self.updated_at = updated_at
237240
self.groups_permissions = groups_permissions
238-
self.user_permission = user_permission
239-
self.created_by = created_by
240-
self.id = id
241-
self.nature = nature
242241
self.name = name
242+
self.user_permission = user_permission
243243
for var_name, var_value in kwargs.items():
244244
if var_name not in self.attribute_map and \
245245
self._configuration is not None and \
@@ -264,7 +264,6 @@ def __init__(self, name, *args, **kwargs): # noqa: E501
264264
"""WriteFolder - a model defined in OpenAPI
265265
266266
name (str): Name of the folder
267-
268267
Keyword Args:
269268
_check_type (bool): if True, values for parameters in openapi_types
270269
will be type checked and a TypeError will be

docs/CollaborationApi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,13 +1482,13 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
14821482
write_folder_request = [
14831483
WriteFolderRequest(
14841484
parent_id=1,
1485-
default_permission=1,
14861485
name="name_example",
1486+
default_permission=1,
14871487
children=[
14881488
WriteFolder(
14891489
parent_id=1,
1490-
default_permission=1,
14911490
name="name_example",
1491+
default_permission=1,
14921492
children=None,
14931493
),
14941494
],
@@ -1545,7 +1545,7 @@ Name | Type | Description | Notes
15451545
15461546
Create a document
15471547

1548-
Create a document. If the document is one of {'OBJ', 'IFC', 'GLTF', 'DWG', 'DXF', 'PHOTOSPHERE', 'POINT_CLOUD'}, a model will be created and attached to this document Required scopes: document:write
1548+
Create a document. If the document is one of {'GLTF', 'PHOTOSPHERE', 'DWG', 'DXF', 'OBJ', 'IFC', 'POINT_CLOUD'}, a model will be created and attached to this document Required scopes: document:write
15491549

15501550
### Example
15511551

@@ -10927,7 +10927,7 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
1092710927
project_pk = 1 # int | A unique integer value identifying this project.
1092810928
patched_document_text_request = PatchedDocumentTextRequest(
1092910929
text="text_example",
10930-
language="german",
10930+
language="english",
1093110931
) # PatchedDocumentTextRequest | (optional)
1093210932

1093310933
# example passing only required values which don't have defaults set

docs/DocumentText.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**id** | **int** | | [readonly]
88
**text** | **str, none_type** | The full text representation of a document if the feature is enabled and the file format supported | [optional]
9-
**language** | **str, none_type** | * `german` - german * `french` - french * `spanish` - spanish * `english` - english * `italian` - italian | [optional]
9+
**language** | **str, none_type** | * `english` - english * `spanish` - spanish * `german` - german * `italian` - italian * `french` - french | [optional]
1010
**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]
1111

1212
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

docs/PatchedDocumentTextRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**text** | **str, none_type** | The full text representation of a document if the feature is enabled and the file format supported | [optional]
8-
**language** | **str, none_type** | * `german` - german * `french` - french * `spanish` - spanish * `english` - english * `italian` - italian | [optional]
8+
**language** | **str, none_type** | * `english` - english * `spanish` - spanish * `german` - german * `italian` - italian * `french` - french | [optional]
99
**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]
1010

1111
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

docs/UserCloud.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ This is a flattened nested representation of FosUser and UserCloud models in thi
55
## Properties
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8-
**id** | **int** | | [readonly]
9-
**user_id** | **int, none_type** | | [readonly]
8+
**id** | **int, none_type** | | [readonly]
109
**email** | **str** | | [readonly]
1110
**firstname** | **str, none_type** | | [readonly]
1211
**lastname** | **str, none_type** | | [readonly]

docs/WriteFolder.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7+
**created_by** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [readonly]
8+
**nature** | **str** | Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files | [readonly]
9+
**id** | **int** | | [readonly]
710
**type** | **str** | DEPRECATED: Use 'nature' instead. Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files | [readonly]
8-
**updated_at** | **datetime** | Date of the last update | [readonly]
911
**created_at** | **datetime** | Creation date | [readonly]
12+
**updated_at** | **datetime** | Date of the last update | [readonly]
1013
**groups_permissions** | [**[GroupFolderRead]**](GroupFolderRead.md) | List of group permissions | [readonly]
11-
**user_permission** | **int** | Aggregate of group user permissions and folder default permission | [readonly]
12-
**created_by** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [readonly]
13-
**id** | **int** | | [readonly]
14-
**nature** | **str** | Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files | [readonly]
1514
**name** | **str** | Name of the folder |
15+
**user_permission** | **int** | Aggregate of group user permissions and folder default permission | [readonly]
1616
**parent_id** | **int, none_type** | | [optional]
1717
**default_permission** | **int** | Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write | [optional]
1818
**children** | [**[WriteFolder], none_type**](WriteFolder.md) | | [optional]

0 commit comments

Comments
 (0)