Skip to content

Commit 34ee7c9

Browse files
committed
MINOR: Bcf odata (#772)
* implement odata filters * add orderby * factorize * replace test domains with bimdata.test
1 parent d5baa86 commit 34ee7c9

File tree

6 files changed

+67
-10
lines changed

6 files changed

+67
-10
lines changed

bimdata_api_client/api/bcf_api.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,6 +2107,8 @@ def __init__(self, api_client=None):
21072107
'all': [
21082108
'projects_pk',
21092109
'topics_guid',
2110+
'filter',
2111+
'orderby',
21102112
],
21112113
'required': [
21122114
'projects_pk',
@@ -2129,14 +2131,22 @@ def __init__(self, api_client=None):
21292131
(int,),
21302132
'topics_guid':
21312133
(str,),
2134+
'filter':
2135+
(str,),
2136+
'orderby':
2137+
(str,),
21322138
},
21332139
'attribute_map': {
21342140
'projects_pk': 'projects_pk',
21352141
'topics_guid': 'topics_guid',
2142+
'filter': '$filter',
2143+
'orderby': '$orderby',
21362144
},
21372145
'location_map': {
21382146
'projects_pk': 'path',
21392147
'topics_guid': 'path',
2148+
'filter': 'query',
2149+
'orderby': 'query',
21402150
},
21412151
'collection_format_map': {
21422152
}
@@ -2344,6 +2354,8 @@ def __init__(self, api_client=None):
23442354
params_map={
23452355
'all': [
23462356
'projects_pk',
2357+
'filter',
2358+
'orderby',
23472359
'format',
23482360
'ifcs',
23492361
'img_format',
@@ -2372,6 +2384,10 @@ def __init__(self, api_client=None):
23722384
'openapi_types': {
23732385
'projects_pk':
23742386
(int,),
2387+
'filter':
2388+
(str,),
2389+
'orderby':
2390+
(str,),
23752391
'format':
23762392
(str,),
23772393
'ifcs':
@@ -2383,13 +2399,17 @@ def __init__(self, api_client=None):
23832399
},
23842400
'attribute_map': {
23852401
'projects_pk': 'projects_pk',
2402+
'filter': '$filter',
2403+
'orderby': '$orderby',
23862404
'format': 'format',
23872405
'ifcs': 'ifcs',
23882406
'img_format': 'img_format',
23892407
'models': 'models',
23902408
},
23912409
'location_map': {
23922410
'projects_pk': 'path',
2411+
'filter': 'query',
2412+
'orderby': 'query',
23932413
'format': 'query',
23942414
'ifcs': 'query',
23952415
'img_format': 'query',
@@ -2907,6 +2927,8 @@ def __init__(self, api_client=None):
29072927
params_map={
29082928
'all': [
29092929
'projects_pk',
2930+
'filter',
2931+
'orderby',
29102932
'format',
29112933
'ifcs',
29122934
'models',
@@ -2929,6 +2951,10 @@ def __init__(self, api_client=None):
29292951
'openapi_types': {
29302952
'projects_pk':
29312953
(int,),
2954+
'filter':
2955+
(str,),
2956+
'orderby':
2957+
(str,),
29322958
'format':
29332959
(str,),
29342960
'ifcs':
@@ -2938,12 +2964,16 @@ def __init__(self, api_client=None):
29382964
},
29392965
'attribute_map': {
29402966
'projects_pk': 'projects_pk',
2967+
'filter': '$filter',
2968+
'orderby': '$orderby',
29412969
'format': 'format',
29422970
'ifcs': 'ifcs',
29432971
'models': 'models',
29442972
},
29452973
'location_map': {
29462974
'projects_pk': 'path',
2975+
'filter': 'query',
2976+
'orderby': 'query',
29472977
'format': 'query',
29482978
'ifcs': 'query',
29492979
'models': 'query',
@@ -6792,6 +6822,8 @@ def get_comments(
67926822
topics_guid (str):
67936823
67946824
Keyword Args:
6825+
filter (str): OData filters as defined in BCF spec. [optional]
6826+
orderby (str): OData orderby as defined in BCF spec. [optional]
67956827
_return_http_data_only (bool): response data without head status
67966828
code and headers. Default is True.
67976829
_preload_content (bool): if False, the urllib3.HTTPResponse object
@@ -7111,6 +7143,8 @@ def get_full_topics(
71117143
projects_pk (int):
71127144
71137145
Keyword Args:
7146+
filter (str): OData filters as defined in BCF spec. [optional]
7147+
orderby (str): OData orderby as defined in BCF spec. [optional]
71147148
format (str): [optional]
71157149
ifcs ([int]): [optional]
71167150
img_format (str): All snapshot_data will be returned as url instead of base64. [optional] if omitted the server will use the default value of "url"
@@ -7786,6 +7820,8 @@ def get_topics(
77867820
projects_pk (int):
77877821
77887822
Keyword Args:
7823+
filter (str): OData filters as defined in BCF spec. [optional]
7824+
orderby (str): OData orderby as defined in BCF spec. [optional]
77897825
format (str): [optional]
77907826
ifcs ([int]): [optional]
77917827
models ([int]): [optional]

bimdata_api_client/api/collaboration_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8860,7 +8860,7 @@ def create_document(
88608860
):
88618861
"""Create a document # noqa: E501
88628862

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

bimdata_api_client/model/write_folder_request.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ def openapi_types():
9696
"""
9797
return {
9898
'name': (str,), # noqa: E501
99-
'parent_id': (int, none_type,), # noqa: E501
10099
'default_permission': (int,), # noqa: E501
100+
'parent_id': (int, none_type,), # noqa: E501
101101
'children': ([WriteFolderRequest], none_type,), # noqa: E501
102102
}
103103

@@ -108,8 +108,8 @@ def discriminator():
108108

109109
attribute_map = {
110110
'name': 'name', # noqa: E501
111-
'parent_id': 'parent_id', # noqa: E501
112111
'default_permission': 'default_permission', # noqa: E501
112+
'parent_id': 'parent_id', # noqa: E501
113113
'children': 'children', # noqa: E501
114114
}
115115

@@ -157,8 +157,8 @@ def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501
157157
Animal class but this time we won't travel
158158
through its discriminator because we passed in
159159
_visited_composed_classes = (Animal,)
160-
parent_id (int, none_type): [optional] # noqa: E501
161160
default_permission (int): Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write. [optional] # noqa: E501
161+
parent_id (int, none_type): [optional] # noqa: E501
162162
children ([WriteFolderRequest], none_type): [optional] # noqa: E501
163163
"""
164164

@@ -245,8 +245,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501
245245
Animal class but this time we won't travel
246246
through its discriminator because we passed in
247247
_visited_composed_classes = (Animal,)
248-
parent_id (int, none_type): [optional] # noqa: E501
249248
default_permission (int): Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write. [optional] # noqa: E501
249+
parent_id (int, none_type): [optional] # noqa: E501
250250
children ([WriteFolderRequest], none_type): [optional] # noqa: E501
251251
"""
252252

docs/BcfApi.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3878,6 +3878,8 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
38783878
api_instance = bcf_api.BcfApi(api_client)
38793879
projects_pk = 1 # int | A unique integer value identifying this project.
38803880
topics_guid = "topics_guid_example" # str |
3881+
filter = "$filter_example" # str | OData filters as defined in BCF spec (optional)
3882+
orderby = "$orderby_example" # str | OData orderby as defined in BCF spec (optional)
38813883

38823884
# example passing only required values which don't have defaults set
38833885
try:
@@ -3886,6 +3888,15 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
38863888
pprint(api_response)
38873889
except bimdata_api_client.ApiException as e:
38883890
print("Exception when calling BcfApi->get_comments: %s\n" % e)
3891+
3892+
# example passing only required values which don't have defaults set
3893+
# and optional values
3894+
try:
3895+
# Retrieve all comments
3896+
api_response = api_instance.get_comments(projects_pk, topics_guid, filter=filter, orderby=orderby)
3897+
pprint(api_response)
3898+
except bimdata_api_client.ApiException as e:
3899+
print("Exception when calling BcfApi->get_comments: %s\n" % e)
38893900
```
38903901

38913902

@@ -3895,6 +3906,8 @@ Name | Type | Description | Notes
38953906
------------- | ------------- | ------------- | -------------
38963907
**projects_pk** | **int**| A unique integer value identifying this project. |
38973908
**topics_guid** | **str**| |
3909+
**filter** | **str**| OData filters as defined in BCF spec | [optional]
3910+
**orderby** | **str**| OData orderby as defined in BCF spec | [optional]
38983911

38993912
### Return type
39003913

@@ -4303,6 +4316,8 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
43034316
# Create an instance of the API class
43044317
api_instance = bcf_api.BcfApi(api_client)
43054318
projects_pk = 1 # int |
4319+
filter = "$filter_example" # str | OData filters as defined in BCF spec (optional)
4320+
orderby = "$orderby_example" # str | OData orderby as defined in BCF spec (optional)
43064321
format = "format_example" # str | (optional)
43074322
ifcs = [
43084323
1,
@@ -4324,7 +4339,7 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
43244339
# and optional values
43254340
try:
43264341
# Retrieve all full topics
4327-
api_response = api_instance.get_full_topics(projects_pk, format=format, ifcs=ifcs, img_format=img_format, models=models)
4342+
api_response = api_instance.get_full_topics(projects_pk, filter=filter, orderby=orderby, format=format, ifcs=ifcs, img_format=img_format, models=models)
43284343
pprint(api_response)
43294344
except bimdata_api_client.ApiException as e:
43304345
print("Exception when calling BcfApi->get_full_topics: %s\n" % e)
@@ -4336,6 +4351,8 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
43364351
Name | Type | Description | Notes
43374352
------------- | ------------- | ------------- | -------------
43384353
**projects_pk** | **int**| |
4354+
**filter** | **str**| OData filters as defined in BCF spec | [optional]
4355+
**orderby** | **str**| OData orderby as defined in BCF spec | [optional]
43394356
**format** | **str**| | [optional]
43404357
**ifcs** | **[int]**| | [optional]
43414358
**img_format** | **str**| All snapshot_data will be returned as url instead of base64 | [optional] if omitted the server will use the default value of "url"
@@ -5208,6 +5225,8 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
52085225
# Create an instance of the API class
52095226
api_instance = bcf_api.BcfApi(api_client)
52105227
projects_pk = 1 # int |
5228+
filter = "$filter_example" # str | OData filters as defined in BCF spec (optional)
5229+
orderby = "$orderby_example" # str | OData orderby as defined in BCF spec (optional)
52115230
format = "format_example" # str | (optional)
52125231
ifcs = [
52135232
1,
@@ -5228,7 +5247,7 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
52285247
# and optional values
52295248
try:
52305249
# Retrieve all topics
5231-
api_response = api_instance.get_topics(projects_pk, format=format, ifcs=ifcs, models=models)
5250+
api_response = api_instance.get_topics(projects_pk, filter=filter, orderby=orderby, format=format, ifcs=ifcs, models=models)
52325251
pprint(api_response)
52335252
except bimdata_api_client.ApiException as e:
52345253
print("Exception when calling BcfApi->get_topics: %s\n" % e)
@@ -5240,6 +5259,8 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
52405259
Name | Type | Description | Notes
52415260
------------- | ------------- | ------------- | -------------
52425261
**projects_pk** | **int**| |
5262+
**filter** | **str**| OData filters as defined in BCF spec | [optional]
5263+
**orderby** | **str**| OData orderby as defined in BCF spec | [optional]
52435264
**format** | **str**| | [optional]
52445265
**ifcs** | **[int]**| | [optional]
52455266
**models** | **[int]**| | [optional]

docs/CollaborationApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,9 +1482,9 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
14821482
id = 1 # int | A unique integer value identifying this project.
14831483
write_folder_request = [
14841484
WriteFolderRequest(
1485+
default_permission=1,
14851486
parent_id=1,
14861487
name="name_example",
1487-
default_permission=1,
14881488
children=[
14891489
WriteFolderRequest(),
14901490
],
@@ -1541,7 +1541,7 @@ Name | Type | Description | Notes
15411541
15421542
Create a document
15431543

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

15461546
### Example
15471547

docs/WriteFolderRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**name** | **str** | Name of the folder |
8-
**parent_id** | **int, none_type** | | [optional]
98
**default_permission** | **int** | Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write | [optional]
9+
**parent_id** | **int, none_type** | | [optional]
1010
**children** | [**[WriteFolderRequest], none_type**](WriteFolderRequest.md) | | [optional]
1111
**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]
1212

0 commit comments

Comments
 (0)