Skip to content

Commit 2e9098e

Browse files
committed
MINOR: add project webhooks (#827)
* add project webhooks * use only one serializer * add test * add document.deletion hook, better tests for webhooks * add project_id to project.creation webhook * remove breakpoint * send all webhooks from views * add contect to webhook payload serializer * add context to webhook payload serializer * add folder webhooks * wip: add folder webhooks * add invitation webhooks * no more unmocked http calls in tests * add visa webhooks * fix typo * send webhook id in payload * add bcf comment test
1 parent 00beddf commit 2e9098e

File tree

540 files changed

+136856
-3909
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

540 files changed

+136856
-3909
lines changed

.gitlab-ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# ref: https://docs.gitlab.com/ee/ci/README.html
2+
3+
stages:
4+
- test
5+
6+
.tests:
7+
stage: test
8+
script:
9+
- pip install -r requirements.txt
10+
- pip install -r test-requirements.txt
11+
- pytest --cov=bimdata_api_client
12+
13+
test-3.6:
14+
extends: .tests
15+
image: python:3.6-alpine
16+
test-3.7:
17+
extends: .tests
18+
image: python:3.7-alpine
19+
test-3.8:
20+
extends: .tests
21+
image: python:3.8-alpine
22+
test-3.9:
23+
extends: .tests
24+
image: python:3.9-alpine

.openapi-generator/FILES

Lines changed: 269 additions & 269 deletions
Large diffs are not rendered by default.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ install:
1010
- "pip install -r requirements.txt"
1111
- "pip install -r test-requirements.txt"
1212
# command to run tests
13-
script: pytest --cov=bimdata-api-client
13+
script: pytest --cov=bimdata_api_client

README.md

Lines changed: 62 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
2525

2626
Then import the package:
2727
```python
28-
import bimdata-api-client
28+
import bimdata_api_client
2929
```
3030

3131
### Setuptools
@@ -39,7 +39,7 @@ python setup.py install --user
3939

4040
Then import the package:
4141
```python
42-
import bimdata-api-client
42+
import bimdata_api_client
4343
```
4444

4545
## Getting Started
@@ -49,53 +49,53 @@ Please follow the [installation procedure](#installation--usage) and then run th
4949
```python
5050

5151
import time
52-
import bimdata-api-client
52+
import bimdata_api_client
5353
from pprint import pprint
54-
from bimdata-api-client.api import bcf_api
55-
from bimdata-api-client.model.auth import Auth
56-
from bimdata-api-client.model.bcf_project import BcfProject
57-
from bimdata-api-client.model.bcf_project_request import BcfProjectRequest
58-
from bimdata-api-client.model.coloring_definition import ColoringDefinition
59-
from bimdata-api-client.model.comment import Comment
60-
from bimdata-api-client.model.comment_request import CommentRequest
61-
from bimdata-api-client.model.detailed_extensions import DetailedExtensions
62-
from bimdata-api-client.model.extensions import Extensions
63-
from bimdata-api-client.model.full_topic import FullTopic
64-
from bimdata-api-client.model.full_topic_request import FullTopicRequest
65-
from bimdata-api-client.model.label import Label
66-
from bimdata-api-client.model.label_request import LabelRequest
67-
from bimdata-api-client.model.patched_bcf_project_request import PatchedBcfProjectRequest
68-
from bimdata-api-client.model.patched_comment_request import PatchedCommentRequest
69-
from bimdata-api-client.model.patched_full_topic_request import PatchedFullTopicRequest
70-
from bimdata-api-client.model.patched_label_request import PatchedLabelRequest
71-
from bimdata-api-client.model.patched_pin_request import PatchedPinRequest
72-
from bimdata-api-client.model.patched_priority_request import PatchedPriorityRequest
73-
from bimdata-api-client.model.patched_stage_request import PatchedStageRequest
74-
from bimdata-api-client.model.patched_topic_request import PatchedTopicRequest
75-
from bimdata-api-client.model.patched_topic_status_request import PatchedTopicStatusRequest
76-
from bimdata-api-client.model.patched_topic_type_request import PatchedTopicTypeRequest
77-
from bimdata-api-client.model.patched_viewpoint_request import PatchedViewpointRequest
78-
from bimdata-api-client.model.pin import Pin
79-
from bimdata-api-client.model.pin_request import PinRequest
80-
from bimdata-api-client.model.priority import Priority
81-
from bimdata-api-client.model.priority_request import PriorityRequest
82-
from bimdata-api-client.model.selection_definition import SelectionDefinition
83-
from bimdata-api-client.model.self_bcf_user import SelfBcfUser
84-
from bimdata-api-client.model.stage import Stage
85-
from bimdata-api-client.model.stage_request import StageRequest
86-
from bimdata-api-client.model.topic import Topic
87-
from bimdata-api-client.model.topic_request import TopicRequest
88-
from bimdata-api-client.model.topic_status import TopicStatus
89-
from bimdata-api-client.model.topic_status_request import TopicStatusRequest
90-
from bimdata-api-client.model.topic_type import TopicType
91-
from bimdata-api-client.model.topic_type_request import TopicTypeRequest
92-
from bimdata-api-client.model.version import Version
93-
from bimdata-api-client.model.viewpoint import Viewpoint
94-
from bimdata-api-client.model.viewpoint_request import ViewpointRequest
95-
from bimdata-api-client.model.visibility_definition import VisibilityDefinition
54+
from bimdata_api_client.api import bcf_api
55+
from bimdata_api_client.model.auth import Auth
56+
from bimdata_api_client.model.bcf_project import BcfProject
57+
from bimdata_api_client.model.bcf_project_request import BcfProjectRequest
58+
from bimdata_api_client.model.coloring_definition import ColoringDefinition
59+
from bimdata_api_client.model.comment import Comment
60+
from bimdata_api_client.model.comment_request import CommentRequest
61+
from bimdata_api_client.model.detailed_extensions import DetailedExtensions
62+
from bimdata_api_client.model.extensions import Extensions
63+
from bimdata_api_client.model.full_topic import FullTopic
64+
from bimdata_api_client.model.full_topic_request import FullTopicRequest
65+
from bimdata_api_client.model.label import Label
66+
from bimdata_api_client.model.label_request import LabelRequest
67+
from bimdata_api_client.model.patched_bcf_project_request import PatchedBcfProjectRequest
68+
from bimdata_api_client.model.patched_comment_request import PatchedCommentRequest
69+
from bimdata_api_client.model.patched_full_topic_request import PatchedFullTopicRequest
70+
from bimdata_api_client.model.patched_label_request import PatchedLabelRequest
71+
from bimdata_api_client.model.patched_pin_request import PatchedPinRequest
72+
from bimdata_api_client.model.patched_priority_request import PatchedPriorityRequest
73+
from bimdata_api_client.model.patched_stage_request import PatchedStageRequest
74+
from bimdata_api_client.model.patched_topic_request import PatchedTopicRequest
75+
from bimdata_api_client.model.patched_topic_status_request import PatchedTopicStatusRequest
76+
from bimdata_api_client.model.patched_topic_type_request import PatchedTopicTypeRequest
77+
from bimdata_api_client.model.patched_viewpoint_request import PatchedViewpointRequest
78+
from bimdata_api_client.model.pin import Pin
79+
from bimdata_api_client.model.pin_request import PinRequest
80+
from bimdata_api_client.model.priority import Priority
81+
from bimdata_api_client.model.priority_request import PriorityRequest
82+
from bimdata_api_client.model.selection_definition import SelectionDefinition
83+
from bimdata_api_client.model.self_bcf_user import SelfBcfUser
84+
from bimdata_api_client.model.stage import Stage
85+
from bimdata_api_client.model.stage_request import StageRequest
86+
from bimdata_api_client.model.topic import Topic
87+
from bimdata_api_client.model.topic_request import TopicRequest
88+
from bimdata_api_client.model.topic_status import TopicStatus
89+
from bimdata_api_client.model.topic_status_request import TopicStatusRequest
90+
from bimdata_api_client.model.topic_type import TopicType
91+
from bimdata_api_client.model.topic_type_request import TopicTypeRequest
92+
from bimdata_api_client.model.version import Version
93+
from bimdata_api_client.model.viewpoint import Viewpoint
94+
from bimdata_api_client.model.viewpoint_request import ViewpointRequest
95+
from bimdata_api_client.model.visibility_definition import VisibilityDefinition
9696
# Defining the host is optional and defaults to http://localhost
9797
# See configuration.py for a list of all supported configuration parameters.
98-
configuration = bimdata-api-client.Configuration(
98+
configuration = bimdata_api_client.Configuration(
9999
host = "http://localhost"
100100
)
101101

@@ -111,13 +111,13 @@ configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
111111
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
112112

113113
# Configure OAuth2 access token for authorization: BIMData_Connect
114-
configuration = bimdata-api-client.Configuration(
114+
configuration = bimdata_api_client.Configuration(
115115
host = "http://localhost"
116116
)
117117
configuration.access_token = 'YOUR_ACCESS_TOKEN'
118118

119119
# Configure OAuth2 access token for authorization: BIMData_Connect
120-
configuration = bimdata-api-client.Configuration(
120+
configuration = bimdata_api_client.Configuration(
121121
host = "http://localhost"
122122
)
123123
configuration.access_token = 'YOUR_ACCESS_TOKEN'
@@ -130,7 +130,7 @@ configuration.api_key['Bearer'] = 'YOUR_API_KEY'
130130

131131

132132
# Enter a context with an instance of the API client
133-
with bimdata-api-client.ApiClient(configuration) as api_client:
133+
with bimdata_api_client.ApiClient(configuration) as api_client:
134134
# Create an instance of the API class
135135
api_instance = bcf_api.BcfApi(api_client)
136136
projects_pk = 1 # int | A unique integer value identifying this project.
@@ -150,7 +150,7 @@ comment_request = CommentRequest(
150150
# Create a comment
151151
api_response = api_instance.create_comment(projects_pk, topics_guid, comment_request=comment_request)
152152
pprint(api_response)
153-
except bimdata-api-client.ApiException as e:
153+
except bimdata_api_client.ApiException as e:
154154
print("Exception when calling BcfApi->create_comment: %s\n" % e)
155155
```
156156

@@ -493,11 +493,17 @@ Class | Method | HTTP request | Description
493493
*SsoApi* | [**deny_invitation**](docs/SsoApi.md#deny_invitation) | **POST** /identity-provider/invitation/{id}/deny | Deny an invitation
494494
*SsoApi* | [**get_invitation**](docs/SsoApi.md#get_invitation) | **GET** /identity-provider/invitation/{id} | Retrieve an invitation
495495
*SsoApi* | [**get_invitations**](docs/SsoApi.md#get_invitations) | **GET** /identity-provider/invitation | Retrieve all invitations
496+
*WebhookApi* | [**create_project_web_hook**](docs/WebhookApi.md#create_project_web_hook) | **POST** /cloud/{cloud_pk}/project/{project_pk}/webhook | Create a new project Webhook
496497
*WebhookApi* | [**create_web_hook**](docs/WebhookApi.md#create_web_hook) | **POST** /cloud/{cloud_pk}/webhook | Create a new Webhook
498+
*WebhookApi* | [**delete_project_web_hook**](docs/WebhookApi.md#delete_project_web_hook) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/webhook/{id} | Delete a webhook
497499
*WebhookApi* | [**delete_web_hook**](docs/WebhookApi.md#delete_web_hook) | **DELETE** /cloud/{cloud_pk}/webhook/{id} | Delete a webhook
500+
*WebhookApi* | [**get_project_web_hook**](docs/WebhookApi.md#get_project_web_hook) | **GET** /cloud/{cloud_pk}/project/{project_pk}/webhook/{id} | Retrieve one configured project webhook
501+
*WebhookApi* | [**get_project_web_hooks**](docs/WebhookApi.md#get_project_web_hooks) | **GET** /cloud/{cloud_pk}/project/{project_pk}/webhook | Retrieve all configured project webhooks
498502
*WebhookApi* | [**get_web_hook**](docs/WebhookApi.md#get_web_hook) | **GET** /cloud/{cloud_pk}/webhook/{id} | Retrieve one configured webhook
499503
*WebhookApi* | [**get_web_hooks**](docs/WebhookApi.md#get_web_hooks) | **GET** /cloud/{cloud_pk}/webhook | Retrieve all configured webhooks
504+
*WebhookApi* | [**ping_project_web_hook**](docs/WebhookApi.md#ping_project_web_hook) | **POST** /cloud/{cloud_pk}/project/{project_pk}/webhook/{id}/ping | Test a project webhook
500505
*WebhookApi* | [**ping_web_hook**](docs/WebhookApi.md#ping_web_hook) | **POST** /cloud/{cloud_pk}/webhook/{id}/ping | Test a webhook
506+
*WebhookApi* | [**update_project_web_hook**](docs/WebhookApi.md#update_project_web_hook) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/webhook/{id} | Update some field of a webhook
501507
*WebhookApi* | [**update_web_hook**](docs/WebhookApi.md#update_web_hook) | **PATCH** /cloud/{cloud_pk}/webhook/{id} | Update some field of a webhook
502508

503509

@@ -798,21 +804,21 @@ support@bimdata.io
798804

799805

800806
## Notes for Large OpenAPI documents
801-
If the OpenAPI document is large, imports in bimdata-api-client.apis and bimdata-api-client.models may fail with a
807+
If the OpenAPI document is large, imports in bimdata_api_client.apis and bimdata_api_client.models may fail with a
802808
RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
803809

804810
Solution 1:
805811
Use specific imports for apis and models like:
806-
- `from bimdata-api-client.api.default_api import DefaultApi`
807-
- `from bimdata-api-client.model.pet import Pet`
812+
- `from bimdata_api_client.api.default_api import DefaultApi`
813+
- `from bimdata_api_client.model.pet import Pet`
808814

809815
Solution 2:
810816
Before importing the package, adjust the maximum recursion limit as shown below:
811817
```
812818
import sys
813819
sys.setrecursionlimit(1500)
814-
import bimdata-api-client
815-
from bimdata-api-client.apis import *
816-
from bimdata-api-client.models import *
820+
import bimdata_api_client
821+
from bimdata_api_client.apis import *
822+
from bimdata_api_client.models import *
817823
```
818824

bimdata_api_client/__init__.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# flake8: noqa
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 (v1)
9+
Contact: support@bimdata.io
10+
Generated by: https://openapi-generator.tech
11+
"""
12+
13+
14+
__version__ = "1.0.0"
15+
16+
# import ApiClient
17+
from bimdata_api_client.api_client import ApiClient
18+
19+
# import Configuration
20+
from bimdata_api_client.configuration import Configuration
21+
22+
# import exceptions
23+
from bimdata_api_client.exceptions import OpenApiException
24+
from bimdata_api_client.exceptions import ApiAttributeError
25+
from bimdata_api_client.exceptions import ApiTypeError
26+
from bimdata_api_client.exceptions import ApiValueError
27+
from bimdata_api_client.exceptions import ApiKeyError
28+
from bimdata_api_client.exceptions import ApiException

bimdata_api_client/api/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# do not import all apis into this module because that uses a lot of memory and stack frames
2+
# if you need the ability to import all apis from one package, import them with
3+
# from bimdata_api_client.apis import BcfApi

0 commit comments

Comments
 (0)