Skip to content

Commit 3616fff

Browse files
v2.canvas.created webhook update, SDK version bump (#27)
1 parent 8ba8759 commit 3616fff

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

examples/chem-sync-local-flask/local_app/benchling_app/handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from benchling_sdk.apps.status.errors import AppUserFacingError
44
from benchling_sdk.models.webhooks.v0 import (
5-
CanvasCreatedWebhookV2Beta,
5+
CanvasCreatedWebhookV2,
66
CanvasInitializeWebhookV2,
77
CanvasInteractionWebhookV2,
88
WebhookEnvelopeV0,
@@ -35,7 +35,7 @@ def handle_webhook(webhook_dict: dict[str, Any]) -> None:
3535
render_search_canvas(app, webhook.message)
3636
elif isinstance(webhook.message, CanvasInteractionWebhookV2):
3737
route_interaction_webhook(app, webhook.message)
38-
elif isinstance(webhook.message, CanvasCreatedWebhookV2Beta):
38+
elif isinstance(webhook.message, CanvasCreatedWebhookV2):
3939
render_search_canvas_for_created_canvas(app, webhook.message)
4040
else:
4141
# Should only happen if the app's manifest requests webhooks that aren't handled in its code paths

examples/chem-sync-local-flask/local_app/benchling_app/views/canvas_initialize.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
TextInputUiBlockType,
1111
)
1212
from benchling_sdk.models.webhooks.v0 import (
13-
CanvasCreatedWebhookV2Beta,
13+
CanvasCreatedWebhookV2,
1414
CanvasInitializeWebhookV2,
1515
)
1616

@@ -28,7 +28,7 @@ def render_search_canvas(app: App, canvas_initialized: CanvasInitializeWebhookV2
2828
app.benchling.apps.create_canvas(canvas_builder.to_create())
2929

3030

31-
def render_search_canvas_for_created_canvas(app: App, canvas_created: CanvasCreatedWebhookV2Beta) -> None:
31+
def render_search_canvas_for_created_canvas(app: App, canvas_created: CanvasCreatedWebhookV2) -> None:
3232
with app.create_session_context("Show Sync Search", timeout_seconds=20):
3333
canvas_builder = CanvasBuilder(app_id=app.id, feature_id=canvas_created.feature_id)
3434
canvas_builder.blocks.append(input_blocks())

examples/chem-sync-local-flask/manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ subscriptions:
1515
messages:
1616
- type: v2.canvas.initialized
1717
- type: v2.canvas.userInteracted
18-
- type: v2-beta.canvas.created
18+
- type: v2.canvas.created
1919
configuration:
2020
- name: Sync Folder
2121
type: folder
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
flask~=3.0.2
22
# Cryptography extra needed for webhook verification
3-
benchling-sdk[cryptography]==1.21.1
3+
benchling-sdk[cryptography]==1.22.0

0 commit comments

Comments
 (0)