Skip to content

Commit

Permalink
BUG #111
Browse files Browse the repository at this point in the history
  • Loading branch information
MRyderOC authored Feb 24, 2023
1 parent 2b56a2f commit e627dcb
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/dfcx_scrapi/core/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,22 @@ def update_webhook(

webhook_obj.name = webhook_id

# set environment attributes from kwargs
for key, value in kwargs.items():
setattr(webhook_obj, key, value)
paths = kwargs.keys()
mask = field_mask_pb2.FieldMask(paths=paths)
mask = None
if kwargs:
# set environment attributes from kwargs
for key, value in kwargs.items():
setattr(webhook_obj, key, value)
paths = kwargs.keys()
mask = field_mask_pb2.FieldMask(paths=paths)

client_options = self._set_region(webhook_id)
client = services.webhooks.WebhooksClient(
client_options=client_options, credentials=self.creds)

request = types.webhook.UpdateWebhookRequest()
request.webhook = webhook_obj
request.update_mask = mask
if mask:
request.update_mask = mask

response = client.update_webhook(request)

Expand Down

0 comments on commit e627dcb

Please sign in to comment.