Skip to content

Commit 7a42412

Browse files
committed
PATCH: improve viewpoint pins (#543)
1 parent 27422b1 commit 7a42412

21 files changed

Lines changed: 760 additions & 32 deletions

.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ bimdata_api_client/model/patched_zone_request.py
150150
bimdata_api_client/model/patched_zone_space_request.py
151151
bimdata_api_client/model/perspective_camera.py
152152
bimdata_api_client/model/perspective_camera_request.py
153+
bimdata_api_client/model/pin.py
154+
bimdata_api_client/model/pin_request.py
153155
bimdata_api_client/model/point.py
154156
bimdata_api_client/model/point_request.py
155157
bimdata_api_client/model/positioning_plan.py
@@ -393,6 +395,8 @@ docs/PatchedZoneRequest.md
393395
docs/PatchedZoneSpaceRequest.md
394396
docs/PerspectiveCamera.md
395397
docs/PerspectiveCameraRequest.md
398+
docs/Pin.md
399+
docs/PinRequest.md
396400
docs/Point.md
397401
docs/PointRequest.md
398402
docs/PositioningPlan.md
@@ -639,6 +643,8 @@ test/test_patched_zone_request.py
639643
test/test_patched_zone_space_request.py
640644
test/test_perspective_camera.py
641645
test/test_perspective_camera_request.py
646+
test/test_pin.py
647+
test/test_pin_request.py
642648
test/test_point.py
643649
test/test_point_request.py
644650
test/test_positioning_plan.py

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,8 @@ Class | Method | HTTP request | Description
783783
- [PatchedZoneSpaceRequest](docs/PatchedZoneSpaceRequest.md)
784784
- [PerspectiveCamera](docs/PerspectiveCamera.md)
785785
- [PerspectiveCameraRequest](docs/PerspectiveCameraRequest.md)
786+
- [Pin](docs/Pin.md)
787+
- [PinRequest](docs/PinRequest.md)
786788
- [Point](docs/Point.md)
787789
- [PointRequest](docs/PointRequest.md)
788790
- [PositioningPlan](docs/PositioningPlan.md)

bimdata_api_client/api/collaboration_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7686,7 +7686,7 @@ def create_document(
76867686
):
76877687
"""Create a document # noqa: E501
76887688

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

bimdata_api_client/model/patched_viewpoint_request.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ def lazy_import():
3636
from bimdata_api_client.model.line_request import LineRequest
3737
from bimdata_api_client.model.orthogonal_camera_request import OrthogonalCameraRequest
3838
from bimdata_api_client.model.perspective_camera_request import PerspectiveCameraRequest
39+
from bimdata_api_client.model.pin_request import PinRequest
3940
from bimdata_api_client.model.snapshot_request import SnapshotRequest
4041
globals()['ClippingPlaneRequest'] = ClippingPlaneRequest
4142
globals()['ComponentsParentRequest'] = ComponentsParentRequest
4243
globals()['LineRequest'] = LineRequest
4344
globals()['OrthogonalCameraRequest'] = OrthogonalCameraRequest
4445
globals()['PerspectiveCameraRequest'] = PerspectiveCameraRequest
46+
globals()['PinRequest'] = PinRequest
4547
globals()['SnapshotRequest'] = SnapshotRequest
4648

4749

@@ -115,7 +117,7 @@ def openapi_types():
115117
'clipping_planes': ([ClippingPlaneRequest], none_type,), # noqa: E501
116118
'snapshot': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
117119
'components': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
118-
'pins': ([[float]], none_type,), # noqa: E501
120+
'pins': ([PinRequest], none_type,), # noqa: E501
119121
'temp_id': (int, none_type,), # noqa: E501
120122
}
121123

@@ -188,7 +190,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
188190
clipping_planes ([ClippingPlaneRequest], none_type): [optional] # noqa: E501
189191
snapshot (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
190192
components (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
191-
pins ([[float]], none_type): Non standard field. Pins is a list of points representing annotation positions. [optional] # noqa: E501
193+
pins ([PinRequest], none_type): Non standard field. Pins (or markers/annotations) are points of interest. [optional] # noqa: E501
192194
temp_id (int, none_type): Only used when using POST on the full-topic route to bind viewpoint with comment. [optional] # noqa: E501
193195
"""
194196

@@ -280,7 +282,7 @@ def __init__(self, *args, **kwargs): # noqa: E501
280282
clipping_planes ([ClippingPlaneRequest], none_type): [optional] # noqa: E501
281283
snapshot (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
282284
components (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
283-
pins ([[float]], none_type): Non standard field. Pins is a list of points representing annotation positions. [optional] # noqa: E501
285+
pins ([PinRequest], none_type): Non standard field. Pins (or markers/annotations) are points of interest. [optional] # noqa: E501
284286
temp_id (int, none_type): Only used when using POST on the full-topic route to bind viewpoint with comment. [optional] # noqa: E501
285287
"""
286288

bimdata_api_client/model/pin.py

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
"""
2+
BIMData API
3+
4+
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
5+
6+
The version of the OpenAPI document: v1 (v1)
7+
Contact: support@bimdata.io
8+
Generated by: https://openapi-generator.tech
9+
"""
10+
11+
12+
import re # noqa: F401
13+
import sys # noqa: F401
14+
15+
from bimdata_api_client.model_utils import ( # noqa: F401
16+
ApiTypeError,
17+
ModelComposed,
18+
ModelNormal,
19+
ModelSimple,
20+
cached_property,
21+
change_keys_js_to_python,
22+
convert_js_args_to_python_args,
23+
date,
24+
datetime,
25+
file_type,
26+
none_type,
27+
validate_get_composed_info,
28+
OpenApiModel
29+
)
30+
from bimdata_api_client.exceptions import ApiAttributeError
31+
32+
33+
def lazy_import():
34+
from bimdata_api_client.model.point import Point
35+
globals()['Point'] = Point
36+
37+
38+
class Pin(ModelNormal):
39+
"""NOTE: This class is auto generated by OpenAPI Generator.
40+
Ref: https://openapi-generator.tech
41+
42+
Do not edit the class manually.
43+
44+
Attributes:
45+
allowed_values (dict): The key is the tuple path to the attribute
46+
and the for var_name this is (var_name,). The value is a dict
47+
with a capitalized key describing the allowed value and an allowed
48+
value. These dicts store the allowed enum values.
49+
attribute_map (dict): The key is attribute name
50+
and the value is json key in definition.
51+
discriminator_value_class_map (dict): A dict to go from the discriminator
52+
variable value to the discriminator class name.
53+
validations (dict): The key is the tuple path to the attribute
54+
and the for var_name this is (var_name,). The value is a dict
55+
that stores validations for max_length, min_length, max_items,
56+
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
57+
inclusive_minimum, and regex.
58+
additional_properties_type (tuple): A tuple of classes accepted
59+
as additional properties values.
60+
"""
61+
62+
allowed_values = {
63+
}
64+
65+
validations = {
66+
('name',): {
67+
'max_length': 256,
68+
},
69+
('color',): {
70+
'max_length': 8,
71+
},
72+
}
73+
74+
@cached_property
75+
def additional_properties_type():
76+
"""
77+
This must be a method because a model may have properties that are
78+
of type self, this must run after the class is loaded
79+
"""
80+
lazy_import()
81+
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
82+
83+
_nullable = False
84+
85+
@cached_property
86+
def openapi_types():
87+
"""
88+
This must be a method because a model may have properties that are
89+
of type self, this must run after the class is loaded
90+
91+
Returns
92+
openapi_types (dict): The key is attribute name
93+
and the value is attribute type.
94+
"""
95+
lazy_import()
96+
return {
97+
'point': (Point,), # noqa: E501
98+
'name': (str, none_type,), # noqa: E501
99+
'color': (str, none_type,), # noqa: E501
100+
}
101+
102+
@cached_property
103+
def discriminator():
104+
return None
105+
106+
107+
attribute_map = {
108+
'point': 'point', # noqa: E501
109+
'name': 'name', # noqa: E501
110+
'color': 'color', # noqa: E501
111+
}
112+
113+
read_only_vars = {
114+
}
115+
116+
_composed_schemas = {}
117+
118+
@classmethod
119+
@convert_js_args_to_python_args
120+
def _from_openapi_data(cls, point, *args, **kwargs): # noqa: E501
121+
"""Pin - a model defined in OpenAPI
122+
123+
Args:
124+
point (Point):
125+
126+
Keyword Args:
127+
_check_type (bool): if True, values for parameters in openapi_types
128+
will be type checked and a TypeError will be
129+
raised if the wrong type is input.
130+
Defaults to True
131+
_path_to_item (tuple/list): This is a list of keys or values to
132+
drill down to the model in received_data
133+
when deserializing a response
134+
_spec_property_naming (bool): True if the variable names in the input data
135+
are serialized names, as specified in the OpenAPI document.
136+
False if the variable names in the input data
137+
are pythonic names, e.g. snake case (default)
138+
_configuration (Configuration): the instance to use when
139+
deserializing a file_type parameter.
140+
If passed, type conversion is attempted
141+
If omitted no type conversion is done.
142+
_visited_composed_classes (tuple): This stores a tuple of
143+
classes that we have traveled through so that
144+
if we see that class again we will not use its
145+
discriminator again.
146+
When traveling through a discriminator, the
147+
composed schema that is
148+
is traveled through is added to this set.
149+
For example if Animal has a discriminator
150+
petType and we pass in "Dog", and the class Dog
151+
allOf includes Animal, we move through Animal
152+
once using the discriminator, and pick Dog.
153+
Then in Dog, we will make an instance of the
154+
Animal class but this time we won't travel
155+
through its discriminator because we passed in
156+
_visited_composed_classes = (Animal,)
157+
name (str, none_type): [optional] # noqa: E501
158+
color (str, none_type): [optional] # noqa: E501
159+
"""
160+
161+
_check_type = kwargs.pop('_check_type', True)
162+
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
163+
_path_to_item = kwargs.pop('_path_to_item', ())
164+
_configuration = kwargs.pop('_configuration', None)
165+
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
166+
167+
self = super(OpenApiModel, cls).__new__(cls)
168+
169+
if args:
170+
raise ApiTypeError(
171+
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
172+
args,
173+
self.__class__.__name__,
174+
),
175+
path_to_item=_path_to_item,
176+
valid_classes=(self.__class__,),
177+
)
178+
179+
self._data_store = {}
180+
self._check_type = _check_type
181+
self._spec_property_naming = _spec_property_naming
182+
self._path_to_item = _path_to_item
183+
self._configuration = _configuration
184+
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
185+
186+
self.point = point
187+
for var_name, var_value in kwargs.items():
188+
if var_name not in self.attribute_map and \
189+
self._configuration is not None and \
190+
self._configuration.discard_unknown_keys and \
191+
self.additional_properties_type is None:
192+
# discard variable.
193+
continue
194+
setattr(self, var_name, var_value)
195+
return self
196+
197+
required_properties = set([
198+
'_data_store',
199+
'_check_type',
200+
'_spec_property_naming',
201+
'_path_to_item',
202+
'_configuration',
203+
'_visited_composed_classes',
204+
])
205+
206+
@convert_js_args_to_python_args
207+
def __init__(self, point, *args, **kwargs): # noqa: E501
208+
"""Pin - a model defined in OpenAPI
209+
210+
Args:
211+
point (Point):
212+
213+
Keyword Args:
214+
_check_type (bool): if True, values for parameters in openapi_types
215+
will be type checked and a TypeError will be
216+
raised if the wrong type is input.
217+
Defaults to True
218+
_path_to_item (tuple/list): This is a list of keys or values to
219+
drill down to the model in received_data
220+
when deserializing a response
221+
_spec_property_naming (bool): True if the variable names in the input data
222+
are serialized names, as specified in the OpenAPI document.
223+
False if the variable names in the input data
224+
are pythonic names, e.g. snake case (default)
225+
_configuration (Configuration): the instance to use when
226+
deserializing a file_type parameter.
227+
If passed, type conversion is attempted
228+
If omitted no type conversion is done.
229+
_visited_composed_classes (tuple): This stores a tuple of
230+
classes that we have traveled through so that
231+
if we see that class again we will not use its
232+
discriminator again.
233+
When traveling through a discriminator, the
234+
composed schema that is
235+
is traveled through is added to this set.
236+
For example if Animal has a discriminator
237+
petType and we pass in "Dog", and the class Dog
238+
allOf includes Animal, we move through Animal
239+
once using the discriminator, and pick Dog.
240+
Then in Dog, we will make an instance of the
241+
Animal class but this time we won't travel
242+
through its discriminator because we passed in
243+
_visited_composed_classes = (Animal,)
244+
name (str, none_type): [optional] # noqa: E501
245+
color (str, none_type): [optional] # noqa: E501
246+
"""
247+
248+
_check_type = kwargs.pop('_check_type', True)
249+
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
250+
_path_to_item = kwargs.pop('_path_to_item', ())
251+
_configuration = kwargs.pop('_configuration', None)
252+
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
253+
254+
if args:
255+
raise ApiTypeError(
256+
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
257+
args,
258+
self.__class__.__name__,
259+
),
260+
path_to_item=_path_to_item,
261+
valid_classes=(self.__class__,),
262+
)
263+
264+
self._data_store = {}
265+
self._check_type = _check_type
266+
self._spec_property_naming = _spec_property_naming
267+
self._path_to_item = _path_to_item
268+
self._configuration = _configuration
269+
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
270+
271+
self.point = point
272+
for var_name, var_value in kwargs.items():
273+
if var_name not in self.attribute_map and \
274+
self._configuration is not None and \
275+
self._configuration.discard_unknown_keys and \
276+
self.additional_properties_type is None:
277+
# discard variable.
278+
continue
279+
setattr(self, var_name, var_value)
280+
if var_name in self.read_only_vars:
281+
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
282+
f"class with read only attributes.")

0 commit comments

Comments
 (0)