diff --git a/google/genai/_interactions/resources/webhooks.py b/google/genai/_interactions/resources/webhooks.py index 6a758b919..9f157fa15 100644 --- a/google/genai/_interactions/resources/webhooks.py +++ b/google/genai/_interactions/resources/webhooks.py @@ -91,7 +91,6 @@ def create( ], uri: str, webhook_id: str | Omit = omit, - name: str | Omit = omit, state: Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -123,8 +122,6 @@ def create( webhook_id: Optional. The webhook_id to use for the webhook. If not specified, the server will generate a unique ID. - name: Identifier. The name of the webhook. Format: `webhooks/{webhook_id}` - state: The state of the webhook. extra_headers: Send extra headers @@ -145,7 +142,6 @@ def create( { "subscribed_events": subscribed_events, "uri": uri, - "name": name, "state": state, }, webhook_create_params.WebhookCreateParams, @@ -162,7 +158,7 @@ def create( def update( self, - id: str, + name: str, *, api_version: str | None = None, subscribed_events: List[ @@ -183,7 +179,6 @@ def update( ], uri: str, update_mask: str | Omit = omit, - name: str | Omit = omit, state: Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -214,8 +209,6 @@ def update( update_mask: Optional. The list of fields to update. - name: Identifier. The name of the webhook. Format: `webhooks/{webhook_id}` - state: The state of the webhook. extra_headers: Send extra headers @@ -230,15 +223,14 @@ def update( api_version = self._client._get_api_version_path_param() if not api_version: raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") return self._patch( - path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), + path_template("/{api_version}/{name}", api_version=api_version, name=name), body=maybe_transform( { "subscribed_events": subscribed_events, "uri": uri, - "name": name, "state": state, }, webhook_update_params.WebhookUpdateParams, @@ -310,7 +302,7 @@ def list( def delete( self, - id: str, + name: str, *, api_version: str | None = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -336,10 +328,10 @@ def delete( api_version = self._client._get_api_version_path_param() if not api_version: raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") return self._delete( - path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), + path_template("/{api_version}/{name}", api_version=api_version, name=name), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -348,7 +340,7 @@ def delete( def get( self, - id: str, + name: str, *, api_version: str | None = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -374,10 +366,10 @@ def get( api_version = self._client._get_api_version_path_param() if not api_version: raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") return self._get( - path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), + path_template("/{api_version}/{name}", api_version=api_version, name=name), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -386,7 +378,7 @@ def get( def ping( self, - id: str, + name: str, *, api_version: str | None = None, body: webhook_ping_params.Body | Omit = omit, @@ -415,10 +407,10 @@ def ping( api_version = self._client._get_api_version_path_param() if not api_version: raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") return self._post( - path_template("/{api_version}/webhooks/{id}:ping", api_version=api_version, id=id), + path_template("/{api_version}/{name}:ping", api_version=api_version, name=name), body=maybe_transform(body, webhook_ping_params.WebhookPingParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -428,7 +420,7 @@ def ping( def rotate_signing_secret( self, - id: str, + name: str, *, api_version: str | None = None, revocation_behavior: Literal["revoke_previous_secrets_after_h24", "revoke_previous_secrets_immediately"] @@ -458,10 +450,10 @@ def rotate_signing_secret( api_version = self._client._get_api_version_path_param() if not api_version: raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") return self._post( - path_template("/{api_version}/webhooks/{id}:rotateSigningSecret", api_version=api_version, id=id), + path_template("/{api_version}/{name}:rotateSigningSecret", api_version=api_version, name=name), body=maybe_transform( {"revocation_behavior": revocation_behavior}, webhook_rotate_signing_secret_params.WebhookRotateSigningSecretParams, @@ -515,7 +507,6 @@ async def create( ], uri: str, webhook_id: str | Omit = omit, - name: str | Omit = omit, state: Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -547,8 +538,6 @@ async def create( webhook_id: Optional. The webhook_id to use for the webhook. If not specified, the server will generate a unique ID. - name: Identifier. The name of the webhook. Format: `webhooks/{webhook_id}` - state: The state of the webhook. extra_headers: Send extra headers @@ -569,7 +558,6 @@ async def create( { "subscribed_events": subscribed_events, "uri": uri, - "name": name, "state": state, }, webhook_create_params.WebhookCreateParams, @@ -588,7 +576,7 @@ async def create( async def update( self, - id: str, + name: str, *, api_version: str | None = None, subscribed_events: List[ @@ -609,7 +597,6 @@ async def update( ], uri: str, update_mask: str | Omit = omit, - name: str | Omit = omit, state: Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -640,8 +627,6 @@ async def update( update_mask: Optional. The list of fields to update. - name: Identifier. The name of the webhook. Format: `webhooks/{webhook_id}` - state: The state of the webhook. extra_headers: Send extra headers @@ -656,15 +641,14 @@ async def update( api_version = self._client._get_api_version_path_param() if not api_version: raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") return await self._patch( - path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), + path_template("/{api_version}/{name}", api_version=api_version, name=name), body=await async_maybe_transform( { "subscribed_events": subscribed_events, "uri": uri, - "name": name, "state": state, }, webhook_update_params.WebhookUpdateParams, @@ -738,7 +722,7 @@ async def list( async def delete( self, - id: str, + name: str, *, api_version: str | None = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -764,10 +748,10 @@ async def delete( api_version = self._client._get_api_version_path_param() if not api_version: raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") return await self._delete( - path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), + path_template("/{api_version}/{name}", api_version=api_version, name=name), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -776,7 +760,7 @@ async def delete( async def get( self, - id: str, + name: str, *, api_version: str | None = None, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -802,10 +786,10 @@ async def get( api_version = self._client._get_api_version_path_param() if not api_version: raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") return await self._get( - path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), + path_template("/{api_version}/{name}", api_version=api_version, name=name), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -814,7 +798,7 @@ async def get( async def ping( self, - id: str, + name: str, *, api_version: str | None = None, body: webhook_ping_params.Body | Omit = omit, @@ -843,10 +827,10 @@ async def ping( api_version = self._client._get_api_version_path_param() if not api_version: raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") return await self._post( - path_template("/{api_version}/webhooks/{id}:ping", api_version=api_version, id=id), + path_template("/{api_version}/{name}:ping", api_version=api_version, name=name), body=await async_maybe_transform(body, webhook_ping_params.WebhookPingParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -856,7 +840,7 @@ async def ping( async def rotate_signing_secret( self, - id: str, + name: str, *, api_version: str | None = None, revocation_behavior: Literal["revoke_previous_secrets_after_h24", "revoke_previous_secrets_immediately"] @@ -886,10 +870,10 @@ async def rotate_signing_secret( api_version = self._client._get_api_version_path_param() if not api_version: raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}") - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") return await self._post( - path_template("/{api_version}/webhooks/{id}:rotateSigningSecret", api_version=api_version, id=id), + path_template("/{api_version}/{name}:rotateSigningSecret", api_version=api_version, name=name), body=await async_maybe_transform( {"revocation_behavior": revocation_behavior}, webhook_rotate_signing_secret_params.WebhookRotateSigningSecretParams, diff --git a/google/genai/_interactions/types/webhook.py b/google/genai/_interactions/types/webhook.py index 6ede43548..b2bdfd294 100644 --- a/google/genai/_interactions/types/webhook.py +++ b/google/genai/_interactions/types/webhook.py @@ -64,7 +64,10 @@ class Webhook(BaseModel): """Output only. The timestamp when the webhook was created.""" name: Optional[str] = None - """Identifier. The name of the webhook. Format: `webhooks/{webhook_id}`""" + """Output only. + + Identifier. The name of the webhook. Format: `webhooks/{webhook_id}` + """ new_signing_secret: Optional[str] = None """Output only. The new signing secret for the webhook. Only populated on create.""" diff --git a/google/genai/_interactions/types/webhook_create_params.py b/google/genai/_interactions/types/webhook_create_params.py index 987a494f6..44edaebc2 100644 --- a/google/genai/_interactions/types/webhook_create_params.py +++ b/google/genai/_interactions/types/webhook_create_params.py @@ -67,8 +67,5 @@ class WebhookCreateParams(TypedDict, total=False): generate a unique ID. """ - name: str - """Identifier. The name of the webhook. Format: `webhooks/{webhook_id}`""" - state: Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"] """The state of the webhook.""" diff --git a/google/genai/_interactions/types/webhook_update_params.py b/google/genai/_interactions/types/webhook_update_params.py index a0bd8d035..4079b527e 100644 --- a/google/genai/_interactions/types/webhook_update_params.py +++ b/google/genai/_interactions/types/webhook_update_params.py @@ -63,8 +63,5 @@ class WebhookUpdateParams(TypedDict, total=False): update_mask: str """Optional. The list of fields to update.""" - name: str - """Identifier. The name of the webhook. Format: `webhooks/{webhook_id}`""" - state: Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"] """The state of the webhook."""