Skip to content

Commit 88f7294

Browse files
committed
PATCH: Update fields of userInvitation serializer
1 parent 2238267 commit 88f7294

File tree

8 files changed

+373
-13
lines changed

8 files changed

+373
-13
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ bimdata_api_client/model/topic_type_request.py
238238
bimdata_api_client/model/unit.py
239239
bimdata_api_client/model/unit_request.py
240240
bimdata_api_client/model/user.py
241+
bimdata_api_client/model/user_invitation.py
241242
bimdata_api_client/model/user_project.py
242243
bimdata_api_client/model/user_project_id_request.py
243244
bimdata_api_client/model/view_setup_hints.py
@@ -490,6 +491,7 @@ docs/TopicTypeRequest.md
490491
docs/Unit.md
491492
docs/UnitRequest.md
492493
docs/User.md
494+
docs/UserInvitation.md
493495
docs/UserProject.md
494496
docs/UserProjectIdRequest.md
495497
docs/ViewSetupHints.md
@@ -744,6 +746,7 @@ test/test_topic_type_request.py
744746
test/test_unit.py
745747
test/test_unit_request.py
746748
test/test_user.py
749+
test/test_user_invitation.py
747750
test/test_user_project.py
748751
test/test_user_project_id_request.py
749752
test/test_view_setup_hints.py

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,7 @@ Class | Method | HTTP request | Description
880880
- [Unit](docs/Unit.md)
881881
- [UnitRequest](docs/UnitRequest.md)
882882
- [User](docs/User.md)
883+
- [UserInvitation](docs/UserInvitation.md)
883884
- [UserProject](docs/UserProject.md)
884885
- [UserProjectIdRequest](docs/UserProjectIdRequest.md)
885886
- [ViewSetupHints](docs/ViewSetupHints.md)

bimdata_api_client/api/collaboration_api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
from bimdata_api_client.model.group import Group
3737
from bimdata_api_client.model.group_folder import GroupFolder
3838
from bimdata_api_client.model.group_request import GroupRequest
39-
from bimdata_api_client.model.invitation import Invitation
4039
from bimdata_api_client.model.patched_classification_request import PatchedClassificationRequest
4140
from bimdata_api_client.model.patched_cloud_request import PatchedCloudRequest
4241
from bimdata_api_client.model.patched_document_request import PatchedDocumentRequest
@@ -66,6 +65,7 @@
6665
from bimdata_api_client.model.tag_id_request import TagIdRequest
6766
from bimdata_api_client.model.tag_request import TagRequest
6867
from bimdata_api_client.model.user import User
68+
from bimdata_api_client.model.user_invitation import UserInvitation
6969
from bimdata_api_client.model.user_project import UserProject
7070
from bimdata_api_client.model.user_project_id_request import UserProjectIdRequest
7171
from bimdata_api_client.model.visa import Visa
@@ -4865,7 +4865,7 @@ def __init__(self, api_client=None):
48654865
)
48664866
self.get_user_invitation_endpoint = _Endpoint(
48674867
settings={
4868-
'response_type': (Invitation,),
4868+
'response_type': (UserInvitation,),
48694869
'auth': [
48704870
'ApiKey',
48714871
'BIMData_Connect',
@@ -4919,7 +4919,7 @@ def __init__(self, api_client=None):
49194919
)
49204920
self.get_user_invitations_endpoint = _Endpoint(
49214921
settings={
4922-
'response_type': ([Invitation],),
4922+
'response_type': ([UserInvitation],),
49234923
'auth': [
49244924
'ApiKey',
49254925
'BIMData_Connect',
@@ -8027,7 +8027,7 @@ def create_document(
80278027
):
80288028
"""Create a document # noqa: E501
80298029

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

@@ -13277,7 +13277,7 @@ def get_user_invitation(
1327713277
async_req (bool): execute request asynchronously
1327813278

1327913279
Returns:
13280-
Invitation
13280+
UserInvitation
1328113281
If the method is called asynchronously, returns the request
1328213282
thread.
1328313283
"""
@@ -13352,7 +13352,7 @@ def get_user_invitations(
1335213352
async_req (bool): execute request asynchronously
1335313353

1335413354
Returns:
13355-
[Invitation]
13355+
[UserInvitation]
1335613356
If the method is called asynchronously, returns the request
1335713357
thread.
1335813358
"""
Lines changed: 300 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,300 @@
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.user import User
35+
globals()['User'] = User
36+
37+
38+
class UserInvitation(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+
('status',): {
64+
'A': "A",
65+
'D': "D",
66+
'P': "P",
67+
},
68+
}
69+
70+
validations = {
71+
('redirect_uri',): {
72+
'max_length': 512,
73+
},
74+
}
75+
76+
@cached_property
77+
def additional_properties_type():
78+
"""
79+
This must be a method because a model may have properties that are
80+
of type self, this must run after the class is loaded
81+
"""
82+
lazy_import()
83+
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
84+
85+
_nullable = False
86+
87+
@cached_property
88+
def openapi_types():
89+
"""
90+
This must be a method because a model may have properties that are
91+
of type self, this must run after the class is loaded
92+
93+
Returns
94+
openapi_types (dict): The key is attribute name
95+
and the value is attribute type.
96+
"""
97+
lazy_import()
98+
return {
99+
'id': (int,), # noqa: E501
100+
'redirect_uri': (str,), # noqa: E501
101+
'cloud_name': (str,), # noqa: E501
102+
'sender': (User,), # noqa: E501
103+
'project_name': (str,), # noqa: E501
104+
'status': (str,), # noqa: E501
105+
}
106+
107+
@cached_property
108+
def discriminator():
109+
return None
110+
111+
112+
attribute_map = {
113+
'id': 'id', # noqa: E501
114+
'redirect_uri': 'redirect_uri', # noqa: E501
115+
'cloud_name': 'cloud_name', # noqa: E501
116+
'sender': 'sender', # noqa: E501
117+
'project_name': 'project_name', # noqa: E501
118+
'status': 'status', # noqa: E501
119+
}
120+
121+
read_only_vars = {
122+
'id', # noqa: E501
123+
}
124+
125+
_composed_schemas = {}
126+
127+
@classmethod
128+
@convert_js_args_to_python_args
129+
def _from_openapi_data(cls, id, redirect_uri, cloud_name, sender, *args, **kwargs): # noqa: E501
130+
"""UserInvitation - a model defined in OpenAPI
131+
132+
Args:
133+
id (int):
134+
redirect_uri (str): User will be redirected to this uri when they accept the invitation
135+
cloud_name (str):
136+
sender (User):
137+
138+
Keyword Args:
139+
_check_type (bool): if True, values for parameters in openapi_types
140+
will be type checked and a TypeError will be
141+
raised if the wrong type is input.
142+
Defaults to True
143+
_path_to_item (tuple/list): This is a list of keys or values to
144+
drill down to the model in received_data
145+
when deserializing a response
146+
_spec_property_naming (bool): True if the variable names in the input data
147+
are serialized names, as specified in the OpenAPI document.
148+
False if the variable names in the input data
149+
are pythonic names, e.g. snake case (default)
150+
_configuration (Configuration): the instance to use when
151+
deserializing a file_type parameter.
152+
If passed, type conversion is attempted
153+
If omitted no type conversion is done.
154+
_visited_composed_classes (tuple): This stores a tuple of
155+
classes that we have traveled through so that
156+
if we see that class again we will not use its
157+
discriminator again.
158+
When traveling through a discriminator, the
159+
composed schema that is
160+
is traveled through is added to this set.
161+
For example if Animal has a discriminator
162+
petType and we pass in "Dog", and the class Dog
163+
allOf includes Animal, we move through Animal
164+
once using the discriminator, and pick Dog.
165+
Then in Dog, we will make an instance of the
166+
Animal class but this time we won't travel
167+
through its discriminator because we passed in
168+
_visited_composed_classes = (Animal,)
169+
project_name (str): [optional] # noqa: E501
170+
status (str): A: Accepted D: Denied P: Pending . [optional] # noqa: E501
171+
"""
172+
173+
_check_type = kwargs.pop('_check_type', True)
174+
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
175+
_path_to_item = kwargs.pop('_path_to_item', ())
176+
_configuration = kwargs.pop('_configuration', None)
177+
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
178+
179+
self = super(OpenApiModel, cls).__new__(cls)
180+
181+
if args:
182+
raise ApiTypeError(
183+
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
184+
args,
185+
self.__class__.__name__,
186+
),
187+
path_to_item=_path_to_item,
188+
valid_classes=(self.__class__,),
189+
)
190+
191+
self._data_store = {}
192+
self._check_type = _check_type
193+
self._spec_property_naming = _spec_property_naming
194+
self._path_to_item = _path_to_item
195+
self._configuration = _configuration
196+
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
197+
198+
self.id = id
199+
self.redirect_uri = redirect_uri
200+
self.cloud_name = cloud_name
201+
self.sender = sender
202+
for var_name, var_value in kwargs.items():
203+
if var_name not in self.attribute_map and \
204+
self._configuration is not None and \
205+
self._configuration.discard_unknown_keys and \
206+
self.additional_properties_type is None:
207+
# discard variable.
208+
continue
209+
setattr(self, var_name, var_value)
210+
return self
211+
212+
required_properties = set([
213+
'_data_store',
214+
'_check_type',
215+
'_spec_property_naming',
216+
'_path_to_item',
217+
'_configuration',
218+
'_visited_composed_classes',
219+
])
220+
221+
@convert_js_args_to_python_args
222+
def __init__(self, redirect_uri, cloud_name, sender, *args, **kwargs): # noqa: E501
223+
"""UserInvitation - a model defined in OpenAPI
224+
225+
redirect_uri (str): User will be redirected to this uri when they accept the invitation
226+
cloud_name (str):
227+
sender (User):
228+
229+
Keyword Args:
230+
_check_type (bool): if True, values for parameters in openapi_types
231+
will be type checked and a TypeError will be
232+
raised if the wrong type is input.
233+
Defaults to True
234+
_path_to_item (tuple/list): This is a list of keys or values to
235+
drill down to the model in received_data
236+
when deserializing a response
237+
_spec_property_naming (bool): True if the variable names in the input data
238+
are serialized names, as specified in the OpenAPI document.
239+
False if the variable names in the input data
240+
are pythonic names, e.g. snake case (default)
241+
_configuration (Configuration): the instance to use when
242+
deserializing a file_type parameter.
243+
If passed, type conversion is attempted
244+
If omitted no type conversion is done.
245+
_visited_composed_classes (tuple): This stores a tuple of
246+
classes that we have traveled through so that
247+
if we see that class again we will not use its
248+
discriminator again.
249+
When traveling through a discriminator, the
250+
composed schema that is
251+
is traveled through is added to this set.
252+
For example if Animal has a discriminator
253+
petType and we pass in "Dog", and the class Dog
254+
allOf includes Animal, we move through Animal
255+
once using the discriminator, and pick Dog.
256+
Then in Dog, we will make an instance of the
257+
Animal class but this time we won't travel
258+
through its discriminator because we passed in
259+
_visited_composed_classes = (Animal,)
260+
project_name (str): [optional] # noqa: E501
261+
status (str): A: Accepted D: Denied P: Pending . [optional] # noqa: E501
262+
"""
263+
264+
_check_type = kwargs.pop('_check_type', True)
265+
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
266+
_path_to_item = kwargs.pop('_path_to_item', ())
267+
_configuration = kwargs.pop('_configuration', None)
268+
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
269+
270+
if args:
271+
raise ApiTypeError(
272+
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
273+
args,
274+
self.__class__.__name__,
275+
),
276+
path_to_item=_path_to_item,
277+
valid_classes=(self.__class__,),
278+
)
279+
280+
self._data_store = {}
281+
self._check_type = _check_type
282+
self._spec_property_naming = _spec_property_naming
283+
self._path_to_item = _path_to_item
284+
self._configuration = _configuration
285+
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
286+
287+
self.redirect_uri = redirect_uri
288+
self.cloud_name = cloud_name
289+
self.sender = sender
290+
for var_name, var_value in kwargs.items():
291+
if var_name not in self.attribute_map and \
292+
self._configuration is not None and \
293+
self._configuration.discard_unknown_keys and \
294+
self.additional_properties_type is None:
295+
# discard variable.
296+
continue
297+
setattr(self, var_name, var_value)
298+
if var_name in self.read_only_vars:
299+
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
300+
f"class with read only attributes.")

0 commit comments

Comments
 (0)