Skip to content

Commit 907d342

Browse files
committed
PATCH: better element filter (#889)
* better element filter * remove prints * limit max depth to 4
1 parent d2ad418 commit 907d342

File tree

8 files changed

+61
-61
lines changed

8 files changed

+61
-61
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', 'OBJ', 'DWG', 'IFC', 'DXF', 'GLTF'}, 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 {'POINT_CLOUD', 'DWG', 'OBJ', 'DXF', 'GLTF', 'IFC'}, 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/api/model_api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19727,7 +19727,7 @@ def get_element(
1972719727
):
1972819728
"""Retrieve an element of a model # noqa: E501
1972919729

19730-
Retrieve an element of a model `property_filter` simple syntax: { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" } `property_filter` combinatory syntax: { \"operande\": \"AND\" | \"OR\", \"conditions\": [ { \"operande\": \"AND\" | \"OR\", \"conditions\": [...], } // OR { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" }, ... ] } Required scopes: ifc:read, model:read # noqa: E501
19730+
Retrieve an element of a model `property_filter` simple syntax: { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" } `property_filter` combinatory syntax: { \"operator\": \"AND\" | \"OR\", \"conditions\": [ { \"operator\": \"AND\" | \"OR\", \"conditions\": [...], } // OR { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" }, ... ] } Required scopes: ifc:read, model:read # noqa: E501
1973119731
This method makes a synchronous HTTP request by default. To make an
1973219732
asynchronous HTTP request, please pass async_req=True
1973319733

@@ -20690,7 +20690,7 @@ def get_elements(
2069020690
):
2069120691
"""Retrieve all elements of a model # noqa: E501
2069220692

20693-
Retrieve all elements of a model. If not filtered, the json may be very large. To efficently retrieve all elements and their data, see `getRawElements` or `getSimpleElements` `property_filter` simple syntax: { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" } `property_filter` combinatory syntax: { \"operande\": \"AND\" | \"OR\", \"conditions\": [ { \"operande\": \"AND\" | \"OR\", \"conditions\": [...], } // OR { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" }, ... ] } Required scopes: ifc:read, model:read # noqa: E501
20693+
Retrieve all elements of a model. If not filtered, the json may be very large. To efficently retrieve all elements and their data, see `getRawElements` or `getSimpleElements` `property_filter` simple syntax: { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" } `property_filter` combinatory syntax: { \"operator\": \"AND\" | \"OR\", \"conditions\": [ { \"operator\": \"AND\" | \"OR\", \"conditions\": [...], } // OR { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" }, ... ] } Required scopes: ifc:read, model:read # noqa: E501
2069420694
This method makes a synchronous HTTP request by default. To make an
2069520695
asynchronous HTTP request, please pass async_req=True
2069620696

@@ -22560,7 +22560,7 @@ def get_properties_types(
2256022560
classification (str): [optional]
2256122561
classification__notation (str): [optional]
2256222562
property_filter (str): [optional]
22563-
type (str): [optional]
22563+
type (str): Filter by IfcType. [optional]
2256422564
_return_http_data_only (bool): response data without head status
2256522565
code and headers. Default is True.
2256622566
_preload_content (bool): if False, the urllib3.HTTPResponse object
@@ -22810,7 +22810,7 @@ def get_raw_elements(
2281022810
):
2281122811
"""Retrieve all elements in a optimized format # noqa: E501
2281222812

22813-
Instead of a nested representation, this route respond with a flat structure and indices pointing to related object. The IFC file will not be updated. The created elements will be accessible over the API and when exporting an IFC file. Returns elements, property_sets, properties, definitions and units in a JSON optimized structure `property_filter` simple syntax: { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" } `property_filter` combinatory syntax: { \"operande\": \"AND\" | \"OR\", \"conditions\": [ { \"operande\": \"AND\" | \"OR\", \"conditions\": [...], } // OR { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" }, ... ] } Required scopes: ifc:read, model:read # noqa: E501
22813+
Instead of a nested representation, this route respond with a flat structure and indices pointing to related object. The IFC file will not be updated. The created elements will be accessible over the API and when exporting an IFC file. Returns elements, property_sets, properties, definitions and units in a JSON optimized structure `property_filter` simple syntax: { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" } `property_filter` combinatory syntax: { \"operator\": \"AND\" | \"OR\", \"conditions\": [ { \"operator\": \"AND\" | \"OR\", \"conditions\": [...], } // OR { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" }, ... ] } Required scopes: ifc:read, model:read # noqa: E501
2281422814
This method makes a synchronous HTTP request by default. To make an
2281522815
asynchronous HTTP request, please pass async_req=True
2281622816

@@ -22990,7 +22990,7 @@ def get_simple_elements(
2299022990
):
2299122991
"""Retrieve all elements of a model with a simple value representation # noqa: E501
2299222992

22993-
Retrieve all elements of a model with a simple value representation `property_filter` simple syntax: { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" } `property_filter` combinatory syntax: { \"operande\": \"AND\" | \"OR\", \"conditions\": [ { \"operande\": \"AND\" | \"OR\", \"conditions\": [...], } // OR { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" }, ... ] } Required scopes: ifc:read, model:read # noqa: E501
22993+
Retrieve all elements of a model with a simple value representation `property_filter` simple syntax: { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" } `property_filter` combinatory syntax: { \"operator\": \"AND\" | \"OR\", \"conditions\": [ { \"operator\": \"AND\" | \"OR\", \"conditions\": [...], } // OR { \"name\": \"property_name\", \"comparator\": \"contains\" | \"icontains\" | \"exact\" | \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"startswith\" | \"istartswith\" | \"endswith\" | \"iendswith\", \"value\": \"property_value\" }, ... ] } Required scopes: ifc:read, model:read # noqa: E501
2299422994
This method makes a synchronous HTTP request by default. To make an
2299522995
asynchronous HTTP request, please pass async_req=True
2299622996

bimdata_api_client/model/write_folder.py

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,17 @@ def openapi_types():
107107
"""
108108
lazy_import()
109109
return {
110-
'user_permission': (int,), # noqa: E501
111-
'groups_permissions': ([GroupFolderRead],), # noqa: E501
112-
'id': (int,), # noqa: E501
110+
'updated_at': (datetime,), # noqa: E501
113111
'name': (str,), # noqa: E501
114-
'type': (str,), # noqa: E501
115-
'created_by': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
116112
'nature': (str,), # noqa: E501
117-
'updated_at': (datetime,), # noqa: E501
118113
'created_at': (datetime,), # noqa: E501
119-
'default_permission': (int,), # noqa: E501
114+
'type': (str,), # noqa: E501
115+
'user_permission': (int,), # noqa: E501
116+
'created_by': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
117+
'groups_permissions': ([GroupFolderRead],), # noqa: E501
118+
'id': (int,), # noqa: E501
120119
'parent_id': (int, none_type,), # noqa: E501
120+
'default_permission': (int,), # noqa: E501
121121
'children': ([WriteFolder], none_type,), # noqa: E501
122122
}
123123

@@ -127,48 +127,48 @@ def discriminator():
127127

128128

129129
attribute_map = {
130-
'user_permission': 'user_permission', # noqa: E501
131-
'groups_permissions': 'groups_permissions', # noqa: E501
132-
'id': 'id', # noqa: E501
130+
'updated_at': 'updated_at', # noqa: E501
133131
'name': 'name', # noqa: E501
134-
'type': 'type', # noqa: E501
135-
'created_by': 'created_by', # noqa: E501
136132
'nature': 'nature', # noqa: E501
137-
'updated_at': 'updated_at', # noqa: E501
138133
'created_at': 'created_at', # noqa: E501
139-
'default_permission': 'default_permission', # noqa: E501
134+
'type': 'type', # noqa: E501
135+
'user_permission': 'user_permission', # noqa: E501
136+
'created_by': 'created_by', # noqa: E501
137+
'groups_permissions': 'groups_permissions', # noqa: E501
138+
'id': 'id', # noqa: E501
140139
'parent_id': 'parent_id', # noqa: E501
140+
'default_permission': 'default_permission', # noqa: E501
141141
'children': 'children', # noqa: E501
142142
}
143143

144144
read_only_vars = {
145+
'updated_at', # noqa: E501
146+
'nature', # noqa: E501
147+
'created_at', # noqa: E501
148+
'type', # noqa: E501
145149
'user_permission', # noqa: E501
150+
'created_by', # noqa: E501
146151
'groups_permissions', # noqa: E501
147152
'id', # noqa: E501
148-
'type', # noqa: E501
149-
'created_by', # noqa: E501
150-
'nature', # noqa: E501
151-
'updated_at', # 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, user_permission, groups_permissions, id, name, type, created_by, nature, updated_at, created_at, *args, **kwargs): # noqa: E501
159+
def _from_openapi_data(cls, updated_at, name, nature, created_at, type, user_permission, created_by, groups_permissions, id, *args, **kwargs): # noqa: E501
160160
"""WriteFolder - a model defined in OpenAPI
161161
162162
Args:
163-
user_permission (int): Aggregate of group user permissions and folder default permission
164-
groups_permissions ([GroupFolderRead]): List of group permissions
165-
id (int):
163+
updated_at (datetime): Date of the last update
166164
name (str): Name of the folder
167-
type (str): DEPRECATED: Use 'nature' instead. Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files
168-
created_by (bool, date, datetime, dict, float, int, list, str, none_type):
169165
nature (str): Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files
170-
updated_at (datetime): Date of the last update
171166
created_at (datetime): Creation date
167+
type (str): DEPRECATED: Use 'nature' instead. Value is \"Folder\". It is usefull to parse the tree and discriminate folders and files
168+
user_permission (int): Aggregate of group user permissions and folder default permission
169+
created_by (bool, date, datetime, dict, float, int, list, str, none_type):
170+
groups_permissions ([GroupFolderRead]): List of group permissions
171+
id (int):
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, user_permission, groups_permissions, id, name, type,
201201
Animal class but this time we won't travel
202202
through its discriminator because we passed in
203203
_visited_composed_classes = (Animal,)
204-
default_permission (int): Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write. [optional] # noqa: E501
205204
parent_id (int, none_type): [optional] # noqa: E501
205+
default_permission (int): Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write. [optional] # noqa: E501
206206
children ([WriteFolder], none_type): [optional] # noqa: E501
207207
"""
208208

@@ -231,15 +231,15 @@ def _from_openapi_data(cls, user_permission, groups_permissions, id, name, type,
231231
self._configuration = _configuration
232232
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
233233

234-
self.user_permission = user_permission
235-
self.groups_permissions = groups_permissions
236-
self.id = id
234+
self.updated_at = updated_at
237235
self.name = name
238-
self.type = type
239-
self.created_by = created_by
240236
self.nature = nature
241-
self.updated_at = updated_at
242237
self.created_at = created_at
238+
self.type = type
239+
self.user_permission = user_permission
240+
self.created_by = created_by
241+
self.groups_permissions = groups_permissions
242+
self.id = id
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-
default_permission (int): Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write. [optional] # noqa: E501
299298
parent_id (int, none_type): [optional] # noqa: E501
299+
default_permission (int): Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write. [optional] # noqa: E501
300300
children ([WriteFolder], none_type): [optional] # noqa: E501
301301
"""
302302

0 commit comments

Comments
 (0)