Skip to content

Commit

Permalink
MINOR: Bcf odata (#772)
Browse files Browse the repository at this point in the history
* implement odata filters

* add orderby

* factorize

* replace test domains with bimdata.test
  • Loading branch information
Bimdata-io committed Sep 16, 2024
1 parent d5baa86 commit 34ee7c9
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 10 deletions.
36 changes: 36 additions & 0 deletions bimdata_api_client/api/bcf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2107,6 +2107,8 @@ def __init__(self, api_client=None):
'all': [
'projects_pk',
'topics_guid',
'filter',
'orderby',
],
'required': [
'projects_pk',
Expand All @@ -2129,14 +2131,22 @@ def __init__(self, api_client=None):
(int,),
'topics_guid':
(str,),
'filter':
(str,),
'orderby':
(str,),
},
'attribute_map': {
'projects_pk': 'projects_pk',
'topics_guid': 'topics_guid',
'filter': '$filter',
'orderby': '$orderby',
},
'location_map': {
'projects_pk': 'path',
'topics_guid': 'path',
'filter': 'query',
'orderby': 'query',
},
'collection_format_map': {
}
Expand Down Expand Up @@ -2344,6 +2354,8 @@ def __init__(self, api_client=None):
params_map={
'all': [
'projects_pk',
'filter',
'orderby',
'format',
'ifcs',
'img_format',
Expand Down Expand Up @@ -2372,6 +2384,10 @@ def __init__(self, api_client=None):
'openapi_types': {
'projects_pk':
(int,),
'filter':
(str,),
'orderby':
(str,),
'format':
(str,),
'ifcs':
Expand All @@ -2383,13 +2399,17 @@ def __init__(self, api_client=None):
},
'attribute_map': {
'projects_pk': 'projects_pk',
'filter': '$filter',
'orderby': '$orderby',
'format': 'format',
'ifcs': 'ifcs',
'img_format': 'img_format',
'models': 'models',
},
'location_map': {
'projects_pk': 'path',
'filter': 'query',
'orderby': 'query',
'format': 'query',
'ifcs': 'query',
'img_format': 'query',
Expand Down Expand Up @@ -2907,6 +2927,8 @@ def __init__(self, api_client=None):
params_map={
'all': [
'projects_pk',
'filter',
'orderby',
'format',
'ifcs',
'models',
Expand All @@ -2929,6 +2951,10 @@ def __init__(self, api_client=None):
'openapi_types': {
'projects_pk':
(int,),
'filter':
(str,),
'orderby':
(str,),
'format':
(str,),
'ifcs':
Expand All @@ -2938,12 +2964,16 @@ def __init__(self, api_client=None):
},
'attribute_map': {
'projects_pk': 'projects_pk',
'filter': '$filter',
'orderby': '$orderby',
'format': 'format',
'ifcs': 'ifcs',
'models': 'models',
},
'location_map': {
'projects_pk': 'path',
'filter': 'query',
'orderby': 'query',
'format': 'query',
'ifcs': 'query',
'models': 'query',
Expand Down Expand Up @@ -6792,6 +6822,8 @@ def get_comments(
topics_guid (str):
Keyword Args:
filter (str): OData filters as defined in BCF spec. [optional]
orderby (str): OData orderby as defined in BCF spec. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
Expand Down Expand Up @@ -7111,6 +7143,8 @@ def get_full_topics(
projects_pk (int):
Keyword Args:
filter (str): OData filters as defined in BCF spec. [optional]
orderby (str): OData orderby as defined in BCF spec. [optional]
format (str): [optional]
ifcs ([int]): [optional]
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"
Expand Down Expand Up @@ -7786,6 +7820,8 @@ def get_topics(
projects_pk (int):
Keyword Args:
filter (str): OData filters as defined in BCF spec. [optional]
orderby (str): OData orderby as defined in BCF spec. [optional]
format (str): [optional]
ifcs ([int]): [optional]
models ([int]): [optional]
Expand Down
2 changes: 1 addition & 1 deletion bimdata_api_client/api/collaboration_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8860,7 +8860,7 @@ def create_document(
):
"""Create a document # noqa: E501

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
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
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

Expand Down
8 changes: 4 additions & 4 deletions bimdata_api_client/model/write_folder_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def openapi_types():
"""
return {
'name': (str,), # noqa: E501
'parent_id': (int, none_type,), # noqa: E501
'default_permission': (int,), # noqa: E501
'parent_id': (int, none_type,), # noqa: E501
'children': ([WriteFolderRequest], none_type,), # noqa: E501
}

Expand All @@ -108,8 +108,8 @@ def discriminator():

attribute_map = {
'name': 'name', # noqa: E501
'parent_id': 'parent_id', # noqa: E501
'default_permission': 'default_permission', # noqa: E501
'parent_id': 'parent_id', # noqa: E501
'children': 'children', # noqa: E501
}

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

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

Expand Down
25 changes: 23 additions & 2 deletions docs/BcfApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -3878,6 +3878,8 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
api_instance = bcf_api.BcfApi(api_client)
projects_pk = 1 # int | A unique integer value identifying this project.
topics_guid = "topics_guid_example" # str |
filter = "$filter_example" # str | OData filters as defined in BCF spec (optional)
orderby = "$orderby_example" # str | OData orderby as defined in BCF spec (optional)

# example passing only required values which don't have defaults set
try:
Expand All @@ -3886,6 +3888,15 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
pprint(api_response)
except bimdata_api_client.ApiException as e:
print("Exception when calling BcfApi->get_comments: %s\n" % e)

# example passing only required values which don't have defaults set
# and optional values
try:
# Retrieve all comments
api_response = api_instance.get_comments(projects_pk, topics_guid, filter=filter, orderby=orderby)
pprint(api_response)
except bimdata_api_client.ApiException as e:
print("Exception when calling BcfApi->get_comments: %s\n" % e)
```


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

### Return type

Expand Down Expand Up @@ -4303,6 +4316,8 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = bcf_api.BcfApi(api_client)
projects_pk = 1 # int |
filter = "$filter_example" # str | OData filters as defined in BCF spec (optional)
orderby = "$orderby_example" # str | OData orderby as defined in BCF spec (optional)
format = "format_example" # str | (optional)
ifcs = [
1,
Expand All @@ -4324,7 +4339,7 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
# and optional values
try:
# Retrieve all full topics
api_response = api_instance.get_full_topics(projects_pk, format=format, ifcs=ifcs, img_format=img_format, models=models)
api_response = api_instance.get_full_topics(projects_pk, filter=filter, orderby=orderby, format=format, ifcs=ifcs, img_format=img_format, models=models)
pprint(api_response)
except bimdata_api_client.ApiException as e:
print("Exception when calling BcfApi->get_full_topics: %s\n" % e)
Expand All @@ -4336,6 +4351,8 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**projects_pk** | **int**| |
**filter** | **str**| OData filters as defined in BCF spec | [optional]
**orderby** | **str**| OData orderby as defined in BCF spec | [optional]
**format** | **str**| | [optional]
**ifcs** | **[int]**| | [optional]
**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"
Expand Down Expand Up @@ -5208,6 +5225,8 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = bcf_api.BcfApi(api_client)
projects_pk = 1 # int |
filter = "$filter_example" # str | OData filters as defined in BCF spec (optional)
orderby = "$orderby_example" # str | OData orderby as defined in BCF spec (optional)
format = "format_example" # str | (optional)
ifcs = [
1,
Expand All @@ -5228,7 +5247,7 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
# and optional values
try:
# Retrieve all topics
api_response = api_instance.get_topics(projects_pk, format=format, ifcs=ifcs, models=models)
api_response = api_instance.get_topics(projects_pk, filter=filter, orderby=orderby, format=format, ifcs=ifcs, models=models)
pprint(api_response)
except bimdata_api_client.ApiException as e:
print("Exception when calling BcfApi->get_topics: %s\n" % e)
Expand All @@ -5240,6 +5259,8 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**projects_pk** | **int**| |
**filter** | **str**| OData filters as defined in BCF spec | [optional]
**orderby** | **str**| OData orderby as defined in BCF spec | [optional]
**format** | **str**| | [optional]
**ifcs** | **[int]**| | [optional]
**models** | **[int]**| | [optional]
Expand Down
4 changes: 2 additions & 2 deletions docs/CollaborationApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1482,9 +1482,9 @@ with bimdata_api_client.ApiClient(configuration) as api_client:
id = 1 # int | A unique integer value identifying this project.
write_folder_request = [
WriteFolderRequest(
default_permission=1,
parent_id=1,
name="name_example",
default_permission=1,
children=[
WriteFolderRequest(),
],
Expand Down Expand Up @@ -1541,7 +1541,7 @@ Name | Type | Description | Notes
Create a document

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
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

### Example

Expand Down
2 changes: 1 addition & 1 deletion docs/WriteFolderRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | Name of the folder |
**parent_id** | **int, none_type** | | [optional]
**default_permission** | **int** | Permission for a Folder * `1` - denied * `50` - read_only * `100` - read_write | [optional]
**parent_id** | **int, none_type** | | [optional]
**children** | [**[WriteFolderRequest], none_type**](WriteFolderRequest.md) | | [optional]
**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]

Expand Down

0 comments on commit 34ee7c9

Please sign in to comment.