Skip to content

Commit

Permalink
Added the outgoing webhook methods to scheduler.proto along with the …
Browse files Browse the repository at this point in the history
…corresponding mocked methods in AsyncScheduler.
  • Loading branch information
Randy808 authored and cdecker committed Feb 15, 2024
1 parent b9c9ef3 commit 14aae3d
Show file tree
Hide file tree
Showing 12 changed files with 601 additions and 48 deletions.
18 changes: 18 additions & 0 deletions libs/gl-client-py/glclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,24 @@ def node(self) -> "Node":
def get_invite_codes(self) -> schedpb.ListInviteCodesResponse:
cls = schedpb.ListInviteCodesResponse
return cls.FromString(bytes(self.inner.get_invite_codes()))

def add_outgoing_webhook(self, uri: str) -> schedpb.AddOutgoingWebhookResponse:
res = self.inner.add_outgoing_webhook(uri)
return schedpb.AddOutgoingWebhookResponse.FromString(bytes(res))

def list_outgoing_webhooks(self) -> schedpb.ListOutgoingWebhooksResponse:
res = self.inner.list_outgoing_webhooks()
return schedpb.ListOutgoingWebhooksResponse.FromString(bytes(res))

def delete_outgoing_webhook(self, webhook_id: int) -> None:
res = self.inner.delete_outgoing_webhooks([webhook_id])

def delete_outgoing_webhooks(self, webhook_ids: List[int]) -> None:
res = self.inner.delete_outgoing_webhooks(webhook_ids)

def rotate_outgoing_webhook_secret(self, webhook_id: int) -> schedpb.WebhookSecretResponse:
res = self.inner.rotate_outgoing_webhook_secret(webhook_id)
return schedpb.WebhookSecretResponse.FromString(bytes(res))


class Node(object):
Expand Down
5 changes: 5 additions & 0 deletions libs/gl-client-py/glclient/glclient.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class Scheduler:
def schedule(self) -> bytes: ...
def export_node(self) -> bytes: ...
def get_invite_codes(self) -> bytes: ...
def add_outgoing_webhook(self, uri: str) -> bytes: ...
def list_outgoing_webhooks(self) -> bytes: ...
def delete_outgoing_webhook(self, webhook_id: int) -> bytes: ...
def delete_outgoing_webhooks(self, webhook_ids: List[int]) -> bytes: ...
def rotate_outgoing_webhook_secret(self, webhook_id: int) -> bytes: ...


class Node:
Expand Down
1 change: 1 addition & 0 deletions libs/gl-client-py/glclient/greenlight_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

107 changes: 62 additions & 45 deletions libs/gl-client-py/glclient/scheduler_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 14aae3d

Please sign in to comment.