Skip to content

Commit 68a02e7

Browse files
committed
MINOR: add element/documents route
1 parent 6ebdc2e commit 68a02e7

File tree

9 files changed

+610
-0
lines changed

9 files changed

+610
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ Class | Method | HTTP request | Description
316316
*IfcApi* | [**get_classifications_of_element**](docs/IfcApi.md#get_classifications_of_element) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/classification | Retrieve all classifications of an element
317317
*IfcApi* | [**get_documents_of_element**](docs/IfcApi.md#get_documents_of_element) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/documents | Retrieve all documents of an element
318318
*IfcApi* | [**get_element**](docs/IfcApi.md#get_element) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{uuid} | Retrieve an element of a model
319+
*IfcApi* | [**get_element_linked_documents**](docs/IfcApi.md#get_element_linked_documents) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/documents | Retrieve all documents linked to any element
319320
*IfcApi* | [**get_element_property_set**](docs/IfcApi.md#get_element_property_set) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{id} | Retrieve a PropertySet of an element
320321
*IfcApi* | [**get_element_property_set_properties**](docs/IfcApi.md#get_element_property_set_properties) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property | Retrieve all Properties of a PropertySet
321322
*IfcApi* | [**get_element_property_set_property**](docs/IfcApi.md#get_element_property_set_property) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{id} | Retrieve a Property of a PropertySet
@@ -413,6 +414,7 @@ Class | Method | HTTP request | Description
413414
- [ComponentsParent](docs/ComponentsParent.md)
414415
- [Direction](docs/Direction.md)
415416
- [Document](docs/Document.md)
417+
- [DocumentWithElementList](docs/DocumentWithElementList.md)
416418
- [Element](docs/Element.md)
417419
- [ElementClassificationRelation](docs/ElementClassificationRelation.md)
418420
- [ElementPropertySetRelation](docs/ElementPropertySetRelation.md)

bimdata_api_client/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
from bimdata_api_client.models.components_parent import ComponentsParent
4949
from bimdata_api_client.models.direction import Direction
5050
from bimdata_api_client.models.document import Document
51+
from bimdata_api_client.models.document_with_element_list import DocumentWithElementList
5152
from bimdata_api_client.models.element import Element
5253
from bimdata_api_client.models.element_classification_relation import ElementClassificationRelation
5354
from bimdata_api_client.models.element_property_set_relation import ElementPropertySetRelation

bimdata_api_client/api/ifc_api.py

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7249,6 +7249,153 @@ def get_element_with_http_info(self, cloud_pk, ifc_pk, project_pk, uuid, **kwarg
72497249
_request_timeout=local_var_params.get('_request_timeout'),
72507250
collection_formats=collection_formats)
72517251

7252+
def get_element_linked_documents(self, cloud_pk, ifc_pk, project_pk, **kwargs): # noqa: E501
7253+
"""Retrieve all documents linked to any element # noqa: E501
7254+
7255+
Retrieve all documents linked to any element with the list of uuids Required scopes: ifc:read # noqa: E501
7256+
This method makes a synchronous HTTP request by default. To make an
7257+
asynchronous HTTP request, please pass async_req=True
7258+
>>> thread = api.get_element_linked_documents(cloud_pk, ifc_pk, project_pk, async_req=True)
7259+
>>> result = thread.get()
7260+
7261+
:param async_req bool: execute request asynchronously
7262+
:param str cloud_pk: (required)
7263+
:param str ifc_pk: (required)
7264+
:param str project_pk: (required)
7265+
:param str type: Filter the returned list by type
7266+
:param str classification: Filter the returned list by classification
7267+
:param str classification__notation: Filter the returned list by classification__notation
7268+
:param _preload_content: if False, the urllib3.HTTPResponse object will
7269+
be returned without reading/decoding response
7270+
data. Default is True.
7271+
:param _request_timeout: timeout setting for this request. If one
7272+
number provided, it will be total request
7273+
timeout. It can also be a pair (tuple) of
7274+
(connection, read) timeouts.
7275+
:return: list[DocumentWithElementList]
7276+
If the method is called asynchronously,
7277+
returns the request thread.
7278+
"""
7279+
kwargs['_return_http_data_only'] = True
7280+
return self.get_element_linked_documents_with_http_info(cloud_pk, ifc_pk, project_pk, **kwargs) # noqa: E501
7281+
7282+
def get_element_linked_documents_with_http_info(self, cloud_pk, ifc_pk, project_pk, **kwargs): # noqa: E501
7283+
"""Retrieve all documents linked to any element # noqa: E501
7284+
7285+
Retrieve all documents linked to any element with the list of uuids Required scopes: ifc:read # noqa: E501
7286+
This method makes a synchronous HTTP request by default. To make an
7287+
asynchronous HTTP request, please pass async_req=True
7288+
>>> thread = api.get_element_linked_documents_with_http_info(cloud_pk, ifc_pk, project_pk, async_req=True)
7289+
>>> result = thread.get()
7290+
7291+
:param async_req bool: execute request asynchronously
7292+
:param str cloud_pk: (required)
7293+
:param str ifc_pk: (required)
7294+
:param str project_pk: (required)
7295+
:param str type: Filter the returned list by type
7296+
:param str classification: Filter the returned list by classification
7297+
:param str classification__notation: Filter the returned list by classification__notation
7298+
:param _return_http_data_only: response data without head status code
7299+
and headers
7300+
:param _preload_content: if False, the urllib3.HTTPResponse object will
7301+
be returned without reading/decoding response
7302+
data. Default is True.
7303+
:param _request_timeout: timeout setting for this request. If one
7304+
number provided, it will be total request
7305+
timeout. It can also be a pair (tuple) of
7306+
(connection, read) timeouts.
7307+
:return: tuple(list[DocumentWithElementList], status_code(int), headers(HTTPHeaderDict))
7308+
If the method is called asynchronously,
7309+
returns the request thread.
7310+
"""
7311+
7312+
local_var_params = locals()
7313+
7314+
all_params = [
7315+
'cloud_pk',
7316+
'ifc_pk',
7317+
'project_pk',
7318+
'type',
7319+
'classification',
7320+
'classification__notation'
7321+
]
7322+
all_params.extend(
7323+
[
7324+
'async_req',
7325+
'_return_http_data_only',
7326+
'_preload_content',
7327+
'_request_timeout'
7328+
]
7329+
)
7330+
7331+
for key, val in six.iteritems(local_var_params['kwargs']):
7332+
if key not in all_params:
7333+
raise ApiTypeError(
7334+
"Got an unexpected keyword argument '%s'"
7335+
" to method get_element_linked_documents" % key
7336+
)
7337+
local_var_params[key] = val
7338+
del local_var_params['kwargs']
7339+
# verify the required parameter 'cloud_pk' is set
7340+
if self.api_client.client_side_validation and ('cloud_pk' not in local_var_params or # noqa: E501
7341+
local_var_params['cloud_pk'] is None): # noqa: E501
7342+
raise ApiValueError("Missing the required parameter `cloud_pk` when calling `get_element_linked_documents`") # noqa: E501
7343+
# verify the required parameter 'ifc_pk' is set
7344+
if self.api_client.client_side_validation and ('ifc_pk' not in local_var_params or # noqa: E501
7345+
local_var_params['ifc_pk'] is None): # noqa: E501
7346+
raise ApiValueError("Missing the required parameter `ifc_pk` when calling `get_element_linked_documents`") # noqa: E501
7347+
# verify the required parameter 'project_pk' is set
7348+
if self.api_client.client_side_validation and ('project_pk' not in local_var_params or # noqa: E501
7349+
local_var_params['project_pk'] is None): # noqa: E501
7350+
raise ApiValueError("Missing the required parameter `project_pk` when calling `get_element_linked_documents`") # noqa: E501
7351+
7352+
collection_formats = {}
7353+
7354+
path_params = {}
7355+
if 'cloud_pk' in local_var_params:
7356+
path_params['cloud_pk'] = local_var_params['cloud_pk'] # noqa: E501
7357+
if 'ifc_pk' in local_var_params:
7358+
path_params['ifc_pk'] = local_var_params['ifc_pk'] # noqa: E501
7359+
if 'project_pk' in local_var_params:
7360+
path_params['project_pk'] = local_var_params['project_pk'] # noqa: E501
7361+
7362+
query_params = []
7363+
if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501
7364+
query_params.append(('type', local_var_params['type'])) # noqa: E501
7365+
if 'classification' in local_var_params and local_var_params['classification'] is not None: # noqa: E501
7366+
query_params.append(('classification', local_var_params['classification'])) # noqa: E501
7367+
if 'classification__notation' in local_var_params and local_var_params['classification__notation'] is not None: # noqa: E501
7368+
query_params.append(('classification__notation', local_var_params['classification__notation'])) # noqa: E501
7369+
7370+
header_params = {}
7371+
7372+
form_params = []
7373+
local_var_files = {}
7374+
7375+
body_params = None
7376+
# HTTP header `Accept`
7377+
header_params['Accept'] = self.api_client.select_header_accept(
7378+
['application/json']) # noqa: E501
7379+
7380+
# Authentication setting
7381+
auth_settings = ['Bearer', 'bimdata_connect', 'client_credentials'] # noqa: E501
7382+
7383+
return self.api_client.call_api(
7384+
'/cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/documents', 'GET',
7385+
path_params,
7386+
query_params,
7387+
header_params,
7388+
body=body_params,
7389+
post_params=form_params,
7390+
files=local_var_files,
7391+
response_type='list[DocumentWithElementList]', # noqa: E501
7392+
auth_settings=auth_settings,
7393+
async_req=local_var_params.get('async_req'),
7394+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
7395+
_preload_content=local_var_params.get('_preload_content', True),
7396+
_request_timeout=local_var_params.get('_request_timeout'),
7397+
collection_formats=collection_formats)
7398+
72527399
def get_element_property_set(self, cloud_pk, element_uuid, id, ifc_pk, project_pk, **kwargs): # noqa: E501
72537400
"""Retrieve a PropertySet of an element # noqa: E501
72547401

bimdata_api_client/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from bimdata_api_client.models.components_parent import ComponentsParent
3030
from bimdata_api_client.models.direction import Direction
3131
from bimdata_api_client.models.document import Document
32+
from bimdata_api_client.models.document_with_element_list import DocumentWithElementList
3233
from bimdata_api_client.models.element import Element
3334
from bimdata_api_client.models.element_classification_relation import ElementClassificationRelation
3435
from bimdata_api_client.models.element_property_set_relation import ElementPropertySetRelation
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# coding: utf-8
2+
3+
"""
4+
BIMData API
5+
6+
BIMData API is a tool to interact with your models stored on BIMData’s servers. Through the API, you can manage your projects, the clouds, upload your IFC files and manage them through endpoints. # noqa: E501
7+
8+
The version of the OpenAPI document: v1
9+
Contact: support@bimdata.io
10+
Generated by: https://openapi-generator.tech
11+
"""
12+
13+
14+
import pprint
15+
import re # noqa: F401
16+
17+
import six
18+
19+
from bimdata_api_client.configuration import Configuration
20+
21+
22+
class DocumentWithElementList(object):
23+
"""NOTE: This class is auto generated by OpenAPI Generator.
24+
Ref: https://openapi-generator.tech
25+
26+
Do not edit the class manually.
27+
"""
28+
29+
"""
30+
Attributes:
31+
openapi_types (dict): The key is attribute name
32+
and the value is attribute type.
33+
attribute_map (dict): The key is attribute name
34+
and the value is json key in definition.
35+
"""
36+
openapi_types = {
37+
'document': 'Document',
38+
'element_ids': 'list[int]'
39+
}
40+
41+
attribute_map = {
42+
'document': 'document',
43+
'element_ids': 'element_ids'
44+
}
45+
46+
def __init__(self, document=None, element_ids=None, local_vars_configuration=None): # noqa: E501
47+
"""DocumentWithElementList - a model defined in OpenAPI""" # noqa: E501
48+
if local_vars_configuration is None:
49+
local_vars_configuration = Configuration()
50+
self.local_vars_configuration = local_vars_configuration
51+
52+
self._document = None
53+
self._element_ids = None
54+
self.discriminator = None
55+
56+
if document is not None:
57+
self.document = document
58+
if element_ids is not None:
59+
self.element_ids = element_ids
60+
61+
@property
62+
def document(self):
63+
"""Gets the document of this DocumentWithElementList. # noqa: E501
64+
65+
66+
:return: The document of this DocumentWithElementList. # noqa: E501
67+
:rtype: Document
68+
"""
69+
return self._document
70+
71+
@document.setter
72+
def document(self, document):
73+
"""Sets the document of this DocumentWithElementList.
74+
75+
76+
:param document: The document of this DocumentWithElementList. # noqa: E501
77+
:type: Document
78+
"""
79+
80+
self._document = document
81+
82+
@property
83+
def element_ids(self):
84+
"""Gets the element_ids of this DocumentWithElementList. # noqa: E501
85+
86+
87+
:return: The element_ids of this DocumentWithElementList. # noqa: E501
88+
:rtype: list[int]
89+
"""
90+
return self._element_ids
91+
92+
@element_ids.setter
93+
def element_ids(self, element_ids):
94+
"""Sets the element_ids of this DocumentWithElementList.
95+
96+
97+
:param element_ids: The element_ids of this DocumentWithElementList. # noqa: E501
98+
:type: list[int]
99+
"""
100+
101+
self._element_ids = element_ids
102+
103+
def to_dict(self):
104+
"""Returns the model properties as a dict"""
105+
result = {}
106+
107+
for attr, _ in six.iteritems(self.openapi_types):
108+
value = getattr(self, attr)
109+
if isinstance(value, list):
110+
result[attr] = list(map(
111+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
112+
value
113+
))
114+
elif hasattr(value, "to_dict"):
115+
result[attr] = value.to_dict()
116+
elif isinstance(value, dict):
117+
result[attr] = dict(map(
118+
lambda item: (item[0], item[1].to_dict())
119+
if hasattr(item[1], "to_dict") else item,
120+
value.items()
121+
))
122+
else:
123+
result[attr] = value
124+
125+
return result
126+
127+
def to_str(self):
128+
"""Returns the string representation of the model"""
129+
return pprint.pformat(self.to_dict())
130+
131+
def __repr__(self):
132+
"""For `print` and `pprint`"""
133+
return self.to_str()
134+
135+
def __eq__(self, other):
136+
"""Returns true if both objects are equal"""
137+
if not isinstance(other, DocumentWithElementList):
138+
return False
139+
140+
return self.to_dict() == other.to_dict()
141+
142+
def __ne__(self, other):
143+
"""Returns true if both objects are not equal"""
144+
if not isinstance(other, DocumentWithElementList):
145+
return True
146+
147+
return self.to_dict() != other.to_dict()

docs/DocumentWithElementList.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# DocumentWithElementList
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**document** | [**Document**](Document.md) | | [optional]
7+
**element_ids** | **list[int]** | | [optional] [readonly]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

0 commit comments

Comments
 (0)