Skip to content

Commit 1c52df4

Browse files
committed
PATCH: Fix mask_2d in model, can be null. (#840)
1 parent 713e3b5 commit 1c52df4

14 files changed

+49
-72
lines changed

bimdata_api_client/api/collaboration_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8815,7 +8815,7 @@ def create_document(
88158815
):
88168816
"""Create a document # noqa: E501
88178817

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

bimdata_api_client/model/model.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def openapi_types():
154154
'warnings': ([str], none_type,), # noqa: E501
155155
'parent_id': (int, none_type,), # noqa: E501
156156
'page_number': (int, none_type,), # noqa: E501
157-
'mask_2d': (Mask2D,), # noqa: E501
157+
'mask_2d': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
158158
'children': ([ModelSerializerWithoutChildren],), # noqa: E501
159159
'name': (str, none_type,), # noqa: E501
160160
'source': (str,), # noqa: E501
@@ -231,6 +231,7 @@ def discriminator():
231231
'warnings', # noqa: E501
232232
'parent_id', # noqa: E501
233233
'page_number', # noqa: E501
234+
'mask_2d', # noqa: E501
234235
'children', # noqa: E501
235236
}
236237

@@ -264,7 +265,7 @@ def _from_openapi_data(cls, id, type, creator, status, created_at, updated_at, d
264265
warnings ([str], none_type): List of warnings that happened during IFC processing
265266
parent_id (int, none_type): The first page of the pdf
266267
page_number (int, none_type): The page number of the related pdf
267-
mask_2d (Mask2D):
268+
mask_2d (bool, date, datetime, dict, float, int, list, str, none_type):
268269
children ([ModelSerializerWithoutChildren]): Contains additional pages of a pdf
269270
270271
Keyword Args:
@@ -378,10 +379,9 @@ def _from_openapi_data(cls, id, type, creator, status, created_at, updated_at, d
378379
])
379380

380381
@convert_js_args_to_python_args
381-
def __init__(self, mask_2d, *args, **kwargs): # noqa: E501
382+
def __init__(self, *args, **kwargs): # noqa: E501
382383
"""Model - a model defined in OpenAPI
383384
384-
mask_2d (Mask2D):
385385
Keyword Args:
386386
_check_type (bool): if True, values for parameters in openapi_types
387387
will be type checked and a TypeError will be
@@ -447,7 +447,6 @@ def __init__(self, mask_2d, *args, **kwargs): # noqa: E501
447447
self._configuration = _configuration
448448
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
449449

450-
self.mask_2d = mask_2d
451450
for var_name, var_value in kwargs.items():
452451
if var_name not in self.attribute_map and \
453452
self._configuration is not None and \

bimdata_api_client/model/model_serializer_without_children.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def openapi_types():
152152
'warnings': ([str], none_type,), # noqa: E501
153153
'parent_id': (int, none_type,), # noqa: E501
154154
'page_number': (int, none_type,), # noqa: E501
155-
'mask_2d': (Mask2D,), # noqa: E501
155+
'mask_2d': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
156156
'name': (str, none_type,), # noqa: E501
157157
'source': (str,), # noqa: E501
158158
'world_position': ([float], none_type,), # noqa: E501
@@ -227,6 +227,7 @@ def discriminator():
227227
'warnings', # noqa: E501
228228
'parent_id', # noqa: E501
229229
'page_number', # noqa: E501
230+
'mask_2d', # noqa: E501
230231
}
231232

232233
_composed_schemas = {}
@@ -259,7 +260,7 @@ def _from_openapi_data(cls, id, type, creator, status, created_at, updated_at, d
259260
warnings ([str], none_type): List of warnings that happened during IFC processing
260261
parent_id (int, none_type): The first page of the pdf
261262
page_number (int, none_type): The page number of the related pdf
262-
mask_2d (Mask2D):
263+
mask_2d (bool, date, datetime, dict, float, int, list, str, none_type):
263264
264265
Keyword Args:
265266
_check_type (bool): if True, values for parameters in openapi_types
@@ -371,11 +372,9 @@ def _from_openapi_data(cls, id, type, creator, status, created_at, updated_at, d
371372
])
372373

373374
@convert_js_args_to_python_args
374-
def __init__(self, mask_2d, *args, **kwargs): # noqa: E501
375+
def __init__(self, *args, **kwargs): # noqa: E501
375376
"""ModelSerializerWithoutChildren - a model defined in OpenAPI
376377
377-
mask_2d (Mask2D):
378-
379378
Keyword Args:
380379
_check_type (bool): if True, values for parameters in openapi_types
381380
will be type checked and a TypeError will be
@@ -441,7 +440,6 @@ def __init__(self, mask_2d, *args, **kwargs): # noqa: E501
441440
self._configuration = _configuration
442441
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
443442

444-
self.mask_2d = mask_2d
445443
for var_name, var_value in kwargs.items():
446444
if var_name not in self.attribute_map and \
447445
self._configuration is not None and \

bimdata_api_client/model/patched_model_request.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
from bimdata_api_client.exceptions import ApiAttributeError
3131

3232

33-
def lazy_import():
34-
from bimdata_api_client.model.mask2_d_request import Mask2DRequest
35-
globals()['Mask2DRequest'] = Mask2DRequest
36-
3733

3834
class PatchedModelRequest(ModelNormal):
3935
"""NOTE: This class is auto generated by OpenAPI Generator.
@@ -93,7 +89,6 @@ def additional_properties_type():
9389
This must be a method because a model may have properties that are
9490
of type self, this must run after the class is loaded
9591
"""
96-
lazy_import()
9792
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
9893

9994
_nullable = False
@@ -108,7 +103,6 @@ def openapi_types():
108103
openapi_types (dict): The key is attribute name
109104
and the value is attribute type.
110105
"""
111-
lazy_import()
112106
return {
113107
'name': (str, none_type,), # noqa: E501
114108
'source': (str,), # noqa: E501
@@ -119,7 +113,6 @@ def openapi_types():
119113
'north_vector': ([[float]], none_type,), # noqa: E501
120114
'recommanded_2d_angle': (float, none_type,), # noqa: E501
121115
'layout_name': (str, none_type,), # noqa: E501
122-
'mask_2d': (Mask2DRequest,), # noqa: E501
123116
}
124117

125118
@cached_property
@@ -137,7 +130,6 @@ def discriminator():
137130
'north_vector': 'north_vector', # noqa: E501
138131
'recommanded_2d_angle': 'recommanded_2d_angle', # noqa: E501
139132
'layout_name': 'layout_name', # noqa: E501
140-
'mask_2d': 'mask_2d', # noqa: E501
141133
}
142134

143135
read_only_vars = {
@@ -190,7 +182,6 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
190182
north_vector ([[float]], none_type): This field is only for information. Updating it won't impact the export.. [optional] # noqa: E501
191183
recommanded_2d_angle (float, none_type): This is the angle in clockwise degree to apply on the 2D to optimise the horizontality of objects. This field is only for information. Updating it won't impact the export.. [optional] # noqa: E501
192184
layout_name (str, none_type): The name of the DWG layout (only set when type==DWG). [optional] # noqa: E501
193-
mask_2d (Mask2DRequest): [optional] # noqa: E501
194185
"""
195186

196187
_check_type = kwargs.pop('_check_type', True)
@@ -281,7 +272,6 @@ def __init__(self, *args, **kwargs): # noqa: E501
281272
north_vector ([[float]], none_type): This field is only for information. Updating it won't impact the export.. [optional] # noqa: E501
282273
recommanded_2d_angle (float, none_type): This is the angle in clockwise degree to apply on the 2D to optimise the horizontality of objects. This field is only for information. Updating it won't impact the export.. [optional] # noqa: E501
283274
layout_name (str, none_type): The name of the DWG layout (only set when type==DWG). [optional] # noqa: E501
284-
mask_2d (Mask2DRequest): [optional] # noqa: E501
285275
"""
286276

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

bimdata_api_client/model/write_folder.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@ def openapi_types():
108108
lazy_import()
109109
return {
110110
'nature': (str,), # noqa: E501
111-
'type': (str,), # noqa: E501
112-
'created_at': (datetime,), # noqa: E501
111+
'groups_permissions': ([GroupFolderRead],), # noqa: E501
113112
'created_by': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
113+
'type': (str,), # noqa: E501
114+
'user_permission': (int,), # noqa: E501
114115
'updated_at': (datetime,), # noqa: E501
115116
'id': (int,), # noqa: E501
116-
'groups_permissions': ([GroupFolderRead],), # noqa: E501
117117
'name': (str,), # noqa: E501
118-
'user_permission': (int,), # noqa: E501
119-
'parent_id': (int, none_type,), # noqa: E501
118+
'created_at': (datetime,), # noqa: E501
120119
'default_permission': (int,), # noqa: E501
120+
'parent_id': (int, none_type,), # noqa: E501
121121
'children': ([WriteFolder], none_type,), # noqa: E501
122122
}
123123

@@ -128,47 +128,47 @@ def discriminator():
128128

129129
attribute_map = {
130130
'nature': 'nature', # noqa: E501
131-
'type': 'type', # noqa: E501
132-
'created_at': 'created_at', # noqa: E501
131+
'groups_permissions': 'groups_permissions', # noqa: E501
133132
'created_by': 'created_by', # noqa: E501
133+
'type': 'type', # noqa: E501
134+
'user_permission': 'user_permission', # noqa: E501
134135
'updated_at': 'updated_at', # noqa: E501
135136
'id': 'id', # noqa: E501
136-
'groups_permissions': 'groups_permissions', # noqa: E501
137137
'name': 'name', # noqa: E501
138-
'user_permission': 'user_permission', # noqa: E501
139-
'parent_id': 'parent_id', # noqa: E501
138+
'created_at': 'created_at', # noqa: E501
140139
'default_permission': 'default_permission', # noqa: E501
140+
'parent_id': 'parent_id', # noqa: E501
141141
'children': 'children', # noqa: E501
142142
}
143143

144144
read_only_vars = {
145145
'nature', # noqa: E501
146-
'type', # noqa: E501
147-
'created_at', # noqa: E501
146+
'groups_permissions', # noqa: E501
148147
'created_by', # noqa: E501
148+
'type', # noqa: E501
149+
'user_permission', # noqa: E501
149150
'updated_at', # noqa: E501
150151
'id', # noqa: E501
151-
'groups_permissions', # noqa: E501
152-
'user_permission', # noqa: E501
152+
'created_at', # noqa: E501
153153
}
154154

155155
_composed_schemas = {}
156156

157157
@classmethod
158158
@convert_js_args_to_python_args
159-
def _from_openapi_data(cls, nature, type, created_at, created_by, updated_at, id, groups_permissions, name, user_permission, *args, **kwargs): # noqa: E501
159+
def _from_openapi_data(cls, nature, groups_permissions, created_by, type, user_permission, updated_at, id, name, created_at, *args, **kwargs): # noqa: E501
160160
"""WriteFolder - a model defined in OpenAPI
161161
162162
Args:
163163
nature (str): Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files
164-
type (str): DEPRECATED: Use 'nature' instead. Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files
165-
created_at (datetime): Creation date
164+
groups_permissions ([GroupFolderRead]): List of group permissions
166165
created_by (bool, date, datetime, dict, float, int, list, str, none_type):
166+
type (str): DEPRECATED: Use 'nature' instead. Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files
167+
user_permission (int): Aggregate of group user permissions and folder default permission
167168
updated_at (datetime): Date of the last update
168169
id (int):
169-
groups_permissions ([GroupFolderRead]): List of group permissions
170170
name (str): Name of the folder
171-
user_permission (int): Aggregate of group user permissions and folder default permission
171+
created_at (datetime): Creation date
172172
173173
Keyword Args:
174174
_check_type (bool): if True, values for parameters in openapi_types
@@ -201,8 +201,8 @@ def _from_openapi_data(cls, nature, type, created_at, created_by, updated_at, id
201201
Animal class but this time we won't travel
202202
through its discriminator because we passed in
203203
_visited_composed_classes = (Animal,)
204-
parent_id (int, none_type): [optional] # noqa: E501
205204
default_permission (int): Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write. [optional] # noqa: E501
205+
parent_id (int, none_type): [optional] # noqa: E501
206206
children ([WriteFolder], none_type): [optional] # noqa: E501
207207
"""
208208

@@ -232,14 +232,14 @@ def _from_openapi_data(cls, nature, type, created_at, created_by, updated_at, id
232232
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
233233

234234
self.nature = nature
235-
self.type = type
236-
self.created_at = created_at
235+
self.groups_permissions = groups_permissions
237236
self.created_by = created_by
237+
self.type = type
238+
self.user_permission = user_permission
238239
self.updated_at = updated_at
239240
self.id = id
240-
self.groups_permissions = groups_permissions
241241
self.name = name
242-
self.user_permission = user_permission
242+
self.created_at = created_at
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 \
@@ -295,8 +295,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501
295295
Animal class but this time we won't travel
296296
through its discriminator because we passed in
297297
_visited_composed_classes = (Animal,)
298-
parent_id (int, none_type): [optional] # noqa: E501
299298
default_permission (int): Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write. [optional] # noqa: E501
299+
parent_id (int, none_type): [optional] # noqa: E501
300300
children ([WriteFolder], none_type): [optional] # noqa: E501
301301
"""
302302

bimdata_api_client/model/write_folder_request.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ def openapi_types():
102102
lazy_import()
103103
return {
104104
'name': (str,), # noqa: E501
105-
'parent_id': (int, none_type,), # noqa: E501
106105
'default_permission': (int,), # noqa: E501
106+
'parent_id': (int, none_type,), # noqa: E501
107107
'children': ([WriteFolder], none_type,), # noqa: E501
108108
}
109109

@@ -114,8 +114,8 @@ def discriminator():
114114

115115
attribute_map = {
116116
'name': 'name', # noqa: E501
117-
'parent_id': 'parent_id', # noqa: E501
118117
'default_permission': 'default_permission', # noqa: E501
118+
'parent_id': 'parent_id', # noqa: E501
119119
'children': 'children', # noqa: E501
120120
}
121121

@@ -163,8 +163,8 @@ def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501
163163
Animal class but this time we won't travel
164164
through its discriminator because we passed in
165165
_visited_composed_classes = (Animal,)
166-
parent_id (int, none_type): [optional] # noqa: E501
167166
default_permission (int): Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write. [optional] # noqa: E501
167+
parent_id (int, none_type): [optional] # noqa: E501
168168
children ([WriteFolder], none_type): [optional] # noqa: E501
169169
"""
170170

@@ -251,8 +251,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501
251251
Animal class but this time we won't travel
252252
through its discriminator because we passed in
253253
_visited_composed_classes = (Animal,)
254-
parent_id (int, none_type): [optional] # noqa: E501
255254
default_permission (int): Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write. [optional] # noqa: E501
255+
parent_id (int, none_type): [optional] # noqa: E501
256256
children ([WriteFolder], none_type): [optional] # noqa: E501
257257
"""
258258

docs/CollaborationApi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,14 +1481,14 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
14811481
id = 1 # int | A unique integer value identifying this project.
14821482
write_folder_request = [
14831483
WriteFolderRequest(
1484-
parent_id=1,
14851484
default_permission=1,
14861485
name="name_example",
1486+
parent_id=1,
14871487
children=[
14881488
WriteFolder(
1489-
parent_id=1,
14901489
default_permission=1,
14911490
name="name_example",
1491+
parent_id=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 {'POINT_CLOUD', 'IFC', 'GLTF', 'DWG', 'OBJ', 'DXF'}, a model will be created and attached to this document Required scopes: document:write
1548+
Create a document. If the document is one of {'DXF', 'OBJ', 'IFC', 'DWG', 'GLTF', 'POINT_CLOUD'}, a model will be created and attached to this document Required scopes: document:write
15491549

15501550
### Example
15511551

docs/Model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Name | Type | Description | Notes
2626
**warnings** | **[str], none_type** | List of warnings that happened during IFC processing | [readonly]
2727
**parent_id** | **int, none_type** | The first page of the pdf | [readonly]
2828
**page_number** | **int, none_type** | The page number of the related pdf | [readonly]
29-
**mask_2d** | [**Mask2D**](Mask2D.md) | |
29+
**mask_2d** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [readonly]
3030
**children** | [**[ModelSerializerWithoutChildren]**](ModelSerializerWithoutChildren.md) | Contains additional pages of a pdf | [readonly]
3131
**name** | **str, none_type** | | [optional]
3232
**source** | **str** | * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED | [optional]

docs/ModelApi.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16683,13 +16683,6 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
1668316683
],
1668416684
recommanded_2d_angle=3.14,
1668516685
layout_name="layout_name_example",
16686-
mask_2d=Mask2DRequest(
16687-
crop_path=[
16688-
[
16689-
3.14,
16690-
],
16691-
],
16692-
),
1669316686
) # PatchedModelRequest | (optional)
1669416687

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

docs/ModelSerializerWithoutChildren.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Name | Type | Description | Notes
2626
**warnings** | **[str], none_type** | List of warnings that happened during IFC processing | [readonly]
2727
**parent_id** | **int, none_type** | The first page of the pdf | [readonly]
2828
**page_number** | **int, none_type** | The page number of the related pdf | [readonly]
29-
**mask_2d** | [**Mask2D**](Mask2D.md) | |
29+
**mask_2d** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [readonly]
3030
**name** | **str, none_type** | | [optional]
3131
**source** | **str** | * `UPLOAD` - UPLOAD * `SPLIT` - SPLIT * `MERGE` - MERGE * `EXPORT` - EXPORT * `OPTIMIZED` - OPTIMIZED | [optional]
3232
**world_position** | **[float], none_type** | [x,y,z] array of the position of the local_placement in world coordinates | [optional]

0 commit comments

Comments
 (0)