Skip to content

Commit b1f0958

Browse files
committed
PATCH: add organization serializer in App and MPApp serializers (#452)
* add organization serializer in App and MPApp serializers * fix test and add select related * use Public Organization Serializer
1 parent df65d3d commit b1f0958

File tree

11 files changed

+251
-21
lines changed

11 files changed

+251
-21
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ Class | Method | HTTP request | Description
435435
- [ProjectWithChildren](docs/ProjectWithChildren.md)
436436
- [PropertyDefinition](docs/PropertyDefinition.md)
437437
- [PropertySet](docs/PropertySet.md)
438+
- [PublicOrganization](docs/PublicOrganization.md)
438439
- [RawClassification](docs/RawClassification.md)
439440
- [RawDefinition](docs/RawDefinition.md)
440441
- [RawElement](docs/RawElement.md)

bimdata_api_client/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
from bimdata_api_client.models.project_with_children import ProjectWithChildren
9999
from bimdata_api_client.models.property_definition import PropertyDefinition
100100
from bimdata_api_client.models.property_set import PropertySet
101+
from bimdata_api_client.models.public_organization import PublicOrganization
101102
from bimdata_api_client.models.raw_classification import RawClassification
102103
from bimdata_api_client.models.raw_definition import RawDefinition
103104
from bimdata_api_client.models.raw_element import RawElement

bimdata_api_client/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
from bimdata_api_client.models.project_with_children import ProjectWithChildren
8080
from bimdata_api_client.models.property_definition import PropertyDefinition
8181
from bimdata_api_client.models.property_set import PropertySet
82+
from bimdata_api_client.models.public_organization import PublicOrganization
8283
from bimdata_api_client.models.raw_classification import RawClassification
8384
from bimdata_api_client.models.raw_definition import RawDefinition
8485
from bimdata_api_client.models.raw_element import RawElement

bimdata_api_client/models/marketplace_app.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class MarketplaceApp(object):
4949
'tags': 'list[str]',
5050
'logo': 'str',
5151
'images': 'list[MarketplaceAppImage]',
52-
'organization_id': 'str'
52+
'organization': 'PublicOrganization'
5353
}
5454

5555
attribute_map = {
@@ -68,10 +68,10 @@ class MarketplaceApp(object):
6868
'tags': 'tags',
6969
'logo': 'logo',
7070
'images': 'images',
71-
'organization_id': 'organization_id'
71+
'organization': 'organization'
7272
}
7373

74-
def __init__(self, id=None, name=None, short_description=None, long_description=None, activation_webhook_url=None, post_activation_redirect_uri=None, viewer_plugins_urls=None, webhook_secret=None, creator=None, scopes=None, settings_url=None, is_public=None, tags=None, logo=None, images=None, organization_id=None, local_vars_configuration=None): # noqa: E501
74+
def __init__(self, id=None, name=None, short_description=None, long_description=None, activation_webhook_url=None, post_activation_redirect_uri=None, viewer_plugins_urls=None, webhook_secret=None, creator=None, scopes=None, settings_url=None, is_public=None, tags=None, logo=None, images=None, organization=None, local_vars_configuration=None): # noqa: E501
7575
"""MarketplaceApp - a model defined in OpenAPI""" # noqa: E501
7676
if local_vars_configuration is None:
7777
local_vars_configuration = Configuration()
@@ -92,7 +92,7 @@ def __init__(self, id=None, name=None, short_description=None, long_description=
9292
self._tags = None
9393
self._logo = None
9494
self._images = None
95-
self._organization_id = None
95+
self._organization = None
9696
self.discriminator = None
9797

9898
if id is not None:
@@ -117,8 +117,8 @@ def __init__(self, id=None, name=None, short_description=None, long_description=
117117
self.logo = logo
118118
if images is not None:
119119
self.images = images
120-
if organization_id is not None:
121-
self.organization_id = organization_id
120+
if organization is not None:
121+
self.organization = organization
122122

123123
@property
124124
def id(self):
@@ -471,25 +471,25 @@ def images(self, images):
471471
self._images = images
472472

473473
@property
474-
def organization_id(self):
475-
"""Gets the organization_id of this MarketplaceApp. # noqa: E501
474+
def organization(self):
475+
"""Gets the organization of this MarketplaceApp. # noqa: E501
476476
477477
478-
:return: The organization_id of this MarketplaceApp. # noqa: E501
479-
:rtype: str
478+
:return: The organization of this MarketplaceApp. # noqa: E501
479+
:rtype: PublicOrganization
480480
"""
481-
return self._organization_id
481+
return self._organization
482482

483-
@organization_id.setter
484-
def organization_id(self, organization_id):
485-
"""Sets the organization_id of this MarketplaceApp.
483+
@organization.setter
484+
def organization(self, organization):
485+
"""Sets the organization of this MarketplaceApp.
486486
487487
488-
:param organization_id: The organization_id of this MarketplaceApp. # noqa: E501
489-
:type: str
488+
:param organization: The organization of this MarketplaceApp. # noqa: E501
489+
:type: PublicOrganization
490490
"""
491491

492-
self._organization_id = organization_id
492+
self._organization = organization
493493

494494
def to_dict(self):
495495
"""Returns the model properties as a dict"""
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
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 PublicOrganization(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+
'name': 'str',
38+
'logo': 'str'
39+
}
40+
41+
attribute_map = {
42+
'name': 'name',
43+
'logo': 'logo'
44+
}
45+
46+
def __init__(self, name=None, logo=None, local_vars_configuration=None): # noqa: E501
47+
"""PublicOrganization - 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._name = None
53+
self._logo = None
54+
self.discriminator = None
55+
56+
self.name = name
57+
self.logo = logo
58+
59+
@property
60+
def name(self):
61+
"""Gets the name of this PublicOrganization. # noqa: E501
62+
63+
Name of the organization # noqa: E501
64+
65+
:return: The name of this PublicOrganization. # noqa: E501
66+
:rtype: str
67+
"""
68+
return self._name
69+
70+
@name.setter
71+
def name(self, name):
72+
"""Sets the name of this PublicOrganization.
73+
74+
Name of the organization # noqa: E501
75+
76+
:param name: The name of this PublicOrganization. # noqa: E501
77+
:type: str
78+
"""
79+
if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
80+
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
81+
if (self.local_vars_configuration.client_side_validation and
82+
name is not None and len(name) > 256):
83+
raise ValueError("Invalid value for `name`, length must be less than or equal to `256`") # noqa: E501
84+
if (self.local_vars_configuration.client_side_validation and
85+
name is not None and len(name) < 1):
86+
raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`") # noqa: E501
87+
88+
self._name = name
89+
90+
@property
91+
def logo(self):
92+
"""Gets the logo of this PublicOrganization. # noqa: E501
93+
94+
95+
:return: The logo of this PublicOrganization. # noqa: E501
96+
:rtype: str
97+
"""
98+
return self._logo
99+
100+
@logo.setter
101+
def logo(self, logo):
102+
"""Sets the logo of this PublicOrganization.
103+
104+
105+
:param logo: The logo of this PublicOrganization. # noqa: E501
106+
:type: str
107+
"""
108+
109+
self._logo = logo
110+
111+
def to_dict(self):
112+
"""Returns the model properties as a dict"""
113+
result = {}
114+
115+
for attr, _ in six.iteritems(self.openapi_types):
116+
value = getattr(self, attr)
117+
if isinstance(value, list):
118+
result[attr] = list(map(
119+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
120+
value
121+
))
122+
elif hasattr(value, "to_dict"):
123+
result[attr] = value.to_dict()
124+
elif isinstance(value, dict):
125+
result[attr] = dict(map(
126+
lambda item: (item[0], item[1].to_dict())
127+
if hasattr(item[1], "to_dict") else item,
128+
value.items()
129+
))
130+
else:
131+
result[attr] = value
132+
133+
return result
134+
135+
def to_str(self):
136+
"""Returns the string representation of the model"""
137+
return pprint.pformat(self.to_dict())
138+
139+
def __repr__(self):
140+
"""For `print` and `pprint`"""
141+
return self.to_str()
142+
143+
def __eq__(self, other):
144+
"""Returns true if both objects are equal"""
145+
if not isinstance(other, PublicOrganization):
146+
return False
147+
148+
return self.to_dict() == other.to_dict()
149+
150+
def __ne__(self, other):
151+
"""Returns true if both objects are not equal"""
152+
if not isinstance(other, PublicOrganization):
153+
return True
154+
155+
return self.to_dict() != other.to_dict()

docs/MarketplaceApp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Name | Type | Description | Notes
1818
**tags** | **list[str]** | | [optional]
1919
**logo** | **str** | | [optional] [readonly]
2020
**images** | [**list[MarketplaceAppImage]**](MarketplaceAppImage.md) | | [optional] [readonly]
21-
**organization_id** | **str** | | [optional] [readonly]
21+
**organization** | [**PublicOrganization**](PublicOrganization.md) | | [optional]
2222

2323
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
2424

docs/PublicOrganization.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# PublicOrganization
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**name** | **str** | Name of the organization |
7+
**logo** | **str** | | [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+

test/test_cloud.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ def make_instance(self, include_optional):
8383
image = '0',
8484
order = 56, )
8585
],
86-
organization_id = '0', )
86+
organization = bimdata_api_client.models.public_organization.PublicOrganization(
87+
name = '0',
88+
logo = '0', ), )
8789
],
8890
organization = bimdata_api_client.models.organization.Organization(
8991
id = 56,

test/test_marketplace_app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ def make_instance(self, include_optional):
7474
image = '0',
7575
order = 56, )
7676
],
77-
organization_id = '0'
77+
organization = bimdata_api_client.models.public_organization.PublicOrganization(
78+
name = '0',
79+
logo = '0', )
7880
)
7981
else :
8082
return MarketplaceApp(

test/test_project.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ def make_instance(self, include_optional):
8787
image = '0',
8888
order = 56, )
8989
],
90-
organization_id = '0', )
90+
organization = bimdata_api_client.models.public_organization.PublicOrganization(
91+
name = '0',
92+
logo = '0', ), )
9193
],
9294
organization = bimdata_api_client.models.organization.Organization(
9395
id = 56,

0 commit comments

Comments
 (0)