Skip to content

Commit 64dd9d9

Browse files
google-genai-botcopybara-github
authored andcommitted
chore: Adjust Webhook method and requests
PiperOrigin-RevId: 903895901
1 parent 7c1ecd5 commit 64dd9d9

4 files changed

Lines changed: 12 additions & 34 deletions

File tree

google/genai/_interactions/resources/webhooks.py

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ def create(
9090
]
9191
],
9292
uri: str,
93-
webhook_id: str | Omit = omit,
9493
name: str | Omit = omit,
9594
state: Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"] | Omit = omit,
9695
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -120,10 +119,7 @@ def create(
120119
121120
uri: Required. The URI to which webhook events will be sent.
122121
123-
webhook_id: Optional. The webhook_id to use for the webhook. If not specified, the server
124-
will generate a unique ID.
125-
126-
name: Identifier. The name of the webhook. Format: `webhooks/{webhook_id}`
122+
name: Optional. The user-provided name of the webhook.
127123
128124
state: The state of the webhook.
129125
@@ -151,11 +147,7 @@ def create(
151147
webhook_create_params.WebhookCreateParams,
152148
),
153149
options=make_request_options(
154-
extra_headers=extra_headers,
155-
extra_query=extra_query,
156-
extra_body=extra_body,
157-
timeout=timeout,
158-
query=maybe_transform({"webhook_id": webhook_id}, webhook_create_params.WebhookCreateParams),
150+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
159151
),
160152
cast_to=Webhook,
161153
)
@@ -214,7 +206,7 @@ def update(
214206
215207
update_mask: Optional. The list of fields to update.
216208
217-
name: Identifier. The name of the webhook. Format: `webhooks/{webhook_id}`
209+
name: Optional. The user-provided name of the webhook.
218210
219211
state: The state of the webhook.
220212
@@ -514,7 +506,6 @@ async def create(
514506
]
515507
],
516508
uri: str,
517-
webhook_id: str | Omit = omit,
518509
name: str | Omit = omit,
519510
state: Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"] | Omit = omit,
520511
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -544,10 +535,7 @@ async def create(
544535
545536
uri: Required. The URI to which webhook events will be sent.
546537
547-
webhook_id: Optional. The webhook_id to use for the webhook. If not specified, the server
548-
will generate a unique ID.
549-
550-
name: Identifier. The name of the webhook. Format: `webhooks/{webhook_id}`
538+
name: Optional. The user-provided name of the webhook.
551539
552540
state: The state of the webhook.
553541
@@ -575,13 +563,7 @@ async def create(
575563
webhook_create_params.WebhookCreateParams,
576564
),
577565
options=make_request_options(
578-
extra_headers=extra_headers,
579-
extra_query=extra_query,
580-
extra_body=extra_body,
581-
timeout=timeout,
582-
query=await async_maybe_transform(
583-
{"webhook_id": webhook_id}, webhook_create_params.WebhookCreateParams
584-
),
566+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
585567
),
586568
cast_to=Webhook,
587569
)
@@ -640,7 +622,7 @@ async def update(
640622
641623
update_mask: Optional. The list of fields to update.
642624
643-
name: Identifier. The name of the webhook. Format: `webhooks/{webhook_id}`
625+
name: Optional. The user-provided name of the webhook.
644626
645627
state: The state of the webhook.
646628

google/genai/_interactions/types/webhook.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,14 @@ class Webhook(BaseModel):
6060
uri: str
6161
"""Required. The URI to which webhook events will be sent."""
6262

63+
id: Optional[str] = None
64+
"""Output only. The ID of the webhook."""
65+
6366
create_time: Optional[datetime] = None
6467
"""Output only. The timestamp when the webhook was created."""
6568

6669
name: Optional[str] = None
67-
"""Identifier. The name of the webhook. Format: `webhooks/{webhook_id}`"""
70+
"""Optional. The user-provided name of the webhook."""
6871

6972
new_signing_secret: Optional[str] = None
7073
"""Output only. The new signing secret for the webhook. Only populated on create."""

google/genai/_interactions/types/webhook_create_params.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,8 @@ class WebhookCreateParams(TypedDict, total=False):
6060
uri: Required[str]
6161
"""Required. The URI to which webhook events will be sent."""
6262

63-
webhook_id: str
64-
"""Optional.
65-
66-
The webhook_id to use for the webhook. If not specified, the server will
67-
generate a unique ID.
68-
"""
69-
7063
name: str
71-
"""Identifier. The name of the webhook. Format: `webhooks/{webhook_id}`"""
64+
"""Optional. The user-provided name of the webhook."""
7265

7366
state: Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"]
7467
"""The state of the webhook."""

google/genai/_interactions/types/webhook_update_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class WebhookUpdateParams(TypedDict, total=False):
6464
"""Optional. The list of fields to update."""
6565

6666
name: str
67-
"""Identifier. The name of the webhook. Format: `webhooks/{webhook_id}`"""
67+
"""Optional. The user-provided name of the webhook."""
6868

6969
state: Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"]
7070
"""The state of the webhook."""

0 commit comments

Comments
 (0)