File tree Expand file tree Collapse file tree 2 files changed +1
-2
lines changed
codegen-examples/examples/linear_webhooks
src/codegen/extensions/events Expand file tree Collapse file tree 2 files changed +1
-2
lines changed Original file line number Diff line number Diff line change 9
9
# The @app.linear.event() decorator takes care of subscribing to the webhook and also unsubscribing when the deployment spun
10
10
# Load environment variables from .env file
11
11
12
+
12
13
@app .cls (secrets = [modal .Secret .from_dotenv ()])
13
14
class LinearEventHandlers :
14
15
@modal .enter ()
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ def __init__(self, app: modal.App):
27
27
self .registered_handlers = {}
28
28
self ._webhook_url = None
29
29
30
-
31
30
def subscribe_handler_to_webhook (self , handler : RegisteredWebhookHandler ):
32
31
client = LinearClient (access_token = self .access_token )
33
32
web_url = modal .Function .from_name (app_name = self .app .name , name = handler .handler_func .__qualname__ ).web_url
@@ -55,7 +54,6 @@ def unsubscribe_all_handlers(self):
55
54
for handler in self .registered_handlers :
56
55
self .unsubscribe_handler_to_webhook (self .registered_handlers [handler ])
57
56
58
-
59
57
def event (self , event_name ):
60
58
"""Decorator for registering an event handler.
61
59
You can’t perform that action at this time.
0 commit comments