diff --git a/google/genai/_interactions/_client.py b/google/genai/_interactions/_client.py index ff92c7a91..badceaead 100644 --- a/google/genai/_interactions/_client.py +++ b/google/genai/_interactions/_client.py @@ -49,7 +49,8 @@ from ._client_adapter import GeminiNextGenAPIClientAdapter, AsyncGeminiNextGenAPIClientAdapter if TYPE_CHECKING: - from .resources import interactions + from .resources import webhooks, interactions + from .resources.webhooks import WebhooksResource, AsyncWebhooksResource from .resources.interactions import InteractionsResource, AsyncInteractionsResource __all__ = [ @@ -133,6 +134,12 @@ def interactions(self) -> InteractionsResource: return InteractionsResource(self) + @cached_property + def webhooks(self) -> WebhooksResource: + from .resources.webhooks import WebhooksResource + + return WebhooksResource(self) + @cached_property def with_raw_response(self) -> GeminiNextGenAPIClientWithRawResponse: return GeminiNextGenAPIClientWithRawResponse(self) @@ -354,6 +361,12 @@ def interactions(self) -> AsyncInteractionsResource: return AsyncInteractionsResource(self) + @cached_property + def webhooks(self) -> AsyncWebhooksResource: + from .resources.webhooks import AsyncWebhooksResource + + return AsyncWebhooksResource(self) + @cached_property def with_raw_response(self) -> AsyncGeminiNextGenAPIClientWithRawResponse: return AsyncGeminiNextGenAPIClientWithRawResponse(self) @@ -518,6 +531,12 @@ def interactions(self) -> interactions.InteractionsResourceWithRawResponse: return InteractionsResourceWithRawResponse(self._client.interactions) + @cached_property + def webhooks(self) -> webhooks.WebhooksResourceWithRawResponse: + from .resources.webhooks import WebhooksResourceWithRawResponse + + return WebhooksResourceWithRawResponse(self._client.webhooks) + class AsyncGeminiNextGenAPIClientWithRawResponse: _client: AsyncGeminiNextGenAPIClient @@ -531,6 +550,12 @@ def interactions(self) -> interactions.AsyncInteractionsResourceWithRawResponse: return AsyncInteractionsResourceWithRawResponse(self._client.interactions) + @cached_property + def webhooks(self) -> webhooks.AsyncWebhooksResourceWithRawResponse: + from .resources.webhooks import AsyncWebhooksResourceWithRawResponse + + return AsyncWebhooksResourceWithRawResponse(self._client.webhooks) + class GeminiNextGenAPIClientWithStreamedResponse: _client: GeminiNextGenAPIClient @@ -544,6 +569,12 @@ def interactions(self) -> interactions.InteractionsResourceWithStreamingResponse return InteractionsResourceWithStreamingResponse(self._client.interactions) + @cached_property + def webhooks(self) -> webhooks.WebhooksResourceWithStreamingResponse: + from .resources.webhooks import WebhooksResourceWithStreamingResponse + + return WebhooksResourceWithStreamingResponse(self._client.webhooks) + class AsyncGeminiNextGenAPIClientWithStreamedResponse: _client: AsyncGeminiNextGenAPIClient @@ -557,6 +588,12 @@ def interactions(self) -> interactions.AsyncInteractionsResourceWithStreamingRes return AsyncInteractionsResourceWithStreamingResponse(self._client.interactions) + @cached_property + def webhooks(self) -> webhooks.AsyncWebhooksResourceWithStreamingResponse: + from .resources.webhooks import AsyncWebhooksResourceWithStreamingResponse + + return AsyncWebhooksResourceWithStreamingResponse(self._client.webhooks) + Client = GeminiNextGenAPIClient diff --git a/google/genai/_interactions/resources/__init__.py b/google/genai/_interactions/resources/__init__.py index ab9d39525..02807630b 100644 --- a/google/genai/_interactions/resources/__init__.py +++ b/google/genai/_interactions/resources/__init__.py @@ -15,6 +15,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .webhooks import ( + WebhooksResource, + AsyncWebhooksResource, + WebhooksResourceWithRawResponse, + AsyncWebhooksResourceWithRawResponse, + WebhooksResourceWithStreamingResponse, + AsyncWebhooksResourceWithStreamingResponse, +) from .interactions import ( InteractionsResource, AsyncInteractionsResource, @@ -31,4 +39,10 @@ "AsyncInteractionsResourceWithRawResponse", "InteractionsResourceWithStreamingResponse", "AsyncInteractionsResourceWithStreamingResponse", + "WebhooksResource", + "AsyncWebhooksResource", + "WebhooksResourceWithRawResponse", + "AsyncWebhooksResourceWithRawResponse", + "WebhooksResourceWithStreamingResponse", + "AsyncWebhooksResourceWithStreamingResponse", ] diff --git a/google/genai/_interactions/resources/interactions.py b/google/genai/_interactions/resources/interactions.py index 050185070..adf175a2d 100644 --- a/google/genai/_interactions/resources/interactions.py +++ b/google/genai/_interactions/resources/interactions.py @@ -38,6 +38,7 @@ from ..types.tool_param import ToolParam from ..types.interaction import Interaction from ..types.model_param import ModelParam +from ..types.webhook_config_param import WebhookConfigParam from ..types.interaction_sse_event import InteractionSSEEvent from ..types.generation_config_param import GenerationConfigParam @@ -82,6 +83,7 @@ def create( stream: Literal[False] | Omit = omit, system_instruction: str | Omit = omit, tools: Iterable[ToolParam] | Omit = omit, + webhook_config: WebhookConfigParam | 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. extra_headers: Headers | None = None, @@ -120,6 +122,9 @@ def create( tools: A list of tool declarations the model may call during interaction. + webhook_config: Optional. Webhook configuration for receiving notifications when the interaction + completes. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -148,6 +153,7 @@ def create( store: bool | Omit = omit, system_instruction: str | Omit = omit, tools: Iterable[ToolParam] | Omit = omit, + webhook_config: WebhookConfigParam | 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. extra_headers: Headers | None = None, @@ -186,6 +192,9 @@ def create( tools: A list of tool declarations the model may call during interaction. + webhook_config: Optional. Webhook configuration for receiving notifications when the interaction + completes. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -214,6 +223,7 @@ def create( stream: Literal[False] | Omit = omit, system_instruction: str | Omit = omit, tools: Iterable[ToolParam] | Omit = omit, + webhook_config: WebhookConfigParam | 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. extra_headers: Headers | None = None, @@ -252,6 +262,9 @@ def create( tools: A list of tool declarations the model may call during interaction. + webhook_config: Optional. Webhook configuration for receiving notifications when the interaction + completes. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -280,6 +293,7 @@ def create( store: bool | Omit = omit, system_instruction: str | Omit = omit, tools: Iterable[ToolParam] | Omit = omit, + webhook_config: WebhookConfigParam | 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. extra_headers: Headers | None = None, @@ -318,6 +332,9 @@ def create( tools: A list of tool declarations the model may call during interaction. + webhook_config: Optional. Webhook configuration for receiving notifications when the interaction + completes. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -346,6 +363,7 @@ def create( store: bool | Omit = omit, system_instruction: str | Omit = omit, tools: Iterable[ToolParam] | Omit = omit, + webhook_config: WebhookConfigParam | 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. extra_headers: Headers | None = None, @@ -384,6 +402,9 @@ def create( tools: A list of tool declarations the model may call during interaction. + webhook_config: Optional. Webhook configuration for receiving notifications when the interaction + completes. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -412,6 +433,7 @@ def create( stream: Literal[False] | Literal[True] | Omit = omit, system_instruction: str | Omit = omit, tools: Iterable[ToolParam] | Omit = omit, + webhook_config: WebhookConfigParam | Omit = omit, agent: Union[str, Literal["deep-research-pro-preview-12-2025"]] | Omit = omit, agent_config: interaction_create_params.AgentConfig | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -446,6 +468,7 @@ def create( "stream": stream, "system_instruction": system_instruction, "tools": tools, + "webhook_config": webhook_config, "agent": agent, "agent_config": agent_config, }, @@ -734,6 +757,7 @@ async def create( stream: Literal[False] | Omit = omit, system_instruction: str | Omit = omit, tools: Iterable[ToolParam] | Omit = omit, + webhook_config: WebhookConfigParam | 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. extra_headers: Headers | None = None, @@ -772,6 +796,9 @@ async def create( tools: A list of tool declarations the model may call during interaction. + webhook_config: Optional. Webhook configuration for receiving notifications when the interaction + completes. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -800,6 +827,7 @@ async def create( store: bool | Omit = omit, system_instruction: str | Omit = omit, tools: Iterable[ToolParam] | Omit = omit, + webhook_config: WebhookConfigParam | 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. extra_headers: Headers | None = None, @@ -838,6 +866,9 @@ async def create( tools: A list of tool declarations the model may call during interaction. + webhook_config: Optional. Webhook configuration for receiving notifications when the interaction + completes. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -866,6 +897,7 @@ async def create( stream: Literal[False] | Omit = omit, system_instruction: str | Omit = omit, tools: Iterable[ToolParam] | Omit = omit, + webhook_config: WebhookConfigParam | 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. extra_headers: Headers | None = None, @@ -904,6 +936,9 @@ async def create( tools: A list of tool declarations the model may call during interaction. + webhook_config: Optional. Webhook configuration for receiving notifications when the interaction + completes. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -932,6 +967,7 @@ async def create( store: bool | Omit = omit, system_instruction: str | Omit = omit, tools: Iterable[ToolParam] | Omit = omit, + webhook_config: WebhookConfigParam | 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. extra_headers: Headers | None = None, @@ -970,6 +1006,9 @@ async def create( tools: A list of tool declarations the model may call during interaction. + webhook_config: Optional. Webhook configuration for receiving notifications when the interaction + completes. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -998,6 +1037,7 @@ async def create( store: bool | Omit = omit, system_instruction: str | Omit = omit, tools: Iterable[ToolParam] | Omit = omit, + webhook_config: WebhookConfigParam | 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. extra_headers: Headers | None = None, @@ -1036,6 +1076,9 @@ async def create( tools: A list of tool declarations the model may call during interaction. + webhook_config: Optional. Webhook configuration for receiving notifications when the interaction + completes. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1064,6 +1107,7 @@ async def create( stream: Literal[False] | Literal[True] | Omit = omit, system_instruction: str | Omit = omit, tools: Iterable[ToolParam] | Omit = omit, + webhook_config: WebhookConfigParam | Omit = omit, agent: Union[str, Literal["deep-research-pro-preview-12-2025"]] | Omit = omit, agent_config: interaction_create_params.AgentConfig | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1098,6 +1142,7 @@ async def create( "stream": stream, "system_instruction": system_instruction, "tools": tools, + "webhook_config": webhook_config, "agent": agent, "agent_config": agent_config, }, diff --git a/google/genai/_interactions/resources/webhooks.py b/google/genai/_interactions/resources/webhooks.py new file mode 100644 index 000000000..a3f4e2c91 --- /dev/null +++ b/google/genai/_interactions/resources/webhooks.py @@ -0,0 +1,1011 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import Literal + +import httpx + +from ..types import ( + webhook_list_params, + webhook_ping_params, + webhook_create_params, + webhook_update_params, + webhook_rotate_signing_secret_params, +) +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import path_template, maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.webhook_list_response import WebhookListResponse +from ..types.webhook_ping_response import WebhookPingResponse +from ..types.webhook_create_response import WebhookCreateResponse +from ..types.webhook_delete_response import WebhookDeleteResponse +from ..types.webhook_update_response import WebhookUpdateResponse +from ..types.webhook_retrieve_response import WebhookRetrieveResponse +from ..types.webhook_rotate_signing_secret_response import WebhookRotateSigningSecretResponse + +__all__ = ["WebhooksResource", "AsyncWebhooksResource"] + + +class WebhooksResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> WebhooksResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gemini-next-gen-api-python#accessing-raw-response-data-eg-headers + """ + return WebhooksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> WebhooksResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gemini-next-gen-api-python#with_streaming_response + """ + return WebhooksResourceWithStreamingResponse(self) + + def create( + self, + *, + api_version: str | None = None, + subscribed_events: List[ + Union[ + Literal[ + "batch.succeeded", + "batch.cancelled", + "batch.expired", + "batch.failed", + "interaction.requires_action", + "interaction.completed", + "interaction.failed", + "interaction.cancelled", + "video.generated", + ], + str, + ] + ], + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookCreateResponse: + """Creates a new Webhook. + + Args: + subscribed_events: + Required. + + The events that the webhook is subscribed to. Available events: + + - batch.succeeded + - batch.cancelled + - batch.expired + - batch.failed + - interaction.requires_action + - interaction.completed + - interaction.failed + - interaction.cancelled + - video.generated + + uri: Required. The URI to which webhook events will be sent. + + 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 + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return self._post( + path_template("/{api_version}/webhooks", api_version=api_version), + body=maybe_transform( + { + "subscribed_events": subscribed_events, + "uri": uri, + "name": name, + "state": state, + }, + webhook_create_params.WebhookCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"webhook_id": webhook_id}, webhook_create_params.WebhookCreateParams), + ), + cast_to=WebhookCreateResponse, + ) + + def retrieve( + self, + id: 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookRetrieveResponse: + """ + Gets a specific Webhook. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return self._get( + path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=WebhookRetrieveResponse, + ) + + def update( + self, + id: str, + *, + api_version: str | None = None, + subscribed_events: List[ + Union[ + Literal[ + "batch.succeeded", + "batch.cancelled", + "batch.expired", + "batch.failed", + "interaction.requires_action", + "interaction.completed", + "interaction.failed", + "interaction.cancelled", + "video.generated", + ], + str, + ] + ], + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookUpdateResponse: + """Updates an existing Webhook. + + Args: + subscribed_events: + Required. + + The events that the webhook is subscribed to. Available events: + + - batch.succeeded + - batch.cancelled + - batch.expired + - batch.failed + - interaction.requires_action + - interaction.completed + - interaction.failed + - interaction.cancelled + - video.generated + + uri: Required. The URI to which webhook events will be sent. + + 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 + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return self._patch( + path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), + body=maybe_transform( + { + "subscribed_events": subscribed_events, + "uri": uri, + "name": name, + "state": state, + }, + webhook_update_params.WebhookUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"update_mask": update_mask}, webhook_update_params.WebhookUpdateParams), + ), + cast_to=WebhookUpdateResponse, + ) + + def list( + self, + *, + api_version: str | None = None, + page_size: int | Omit = omit, + page_token: str | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookListResponse: + """Lists all Webhooks. + + Args: + page_size: Optional. + + The maximum number of webhooks to return. The service may return fewer + than this value. If unspecified, at most 50 webhooks will be returned. The + maximum value is 1000. + + page_token: Optional. A page token, received from a previous `ListWebhooks` call. Provide + this to retrieve the subsequent page. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return self._get( + path_template("/{api_version}/webhooks", api_version=api_version), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page_size": page_size, + "page_token": page_token, + }, + webhook_list_params.WebhookListParams, + ), + ), + cast_to=WebhookListResponse, + ) + + def delete( + self, + id: 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookDeleteResponse: + """ + Deletes a Webhook. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return self._delete( + path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=WebhookDeleteResponse, + ) + + def ping( + self, + id: str, + *, + api_version: str | None = None, + body: webhook_ping_params.Body | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookPingResponse: + """ + Sends a ping event to a Webhook. + + Args: + body: Request message for WebhookService.PingWebhook. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return self._post( + path_template("/{api_version}/webhooks/{id}:ping", api_version=api_version, id=id), + 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 + ), + cast_to=WebhookPingResponse, + ) + + def rotate_signing_secret( + self, + id: str, + *, + api_version: str | None = None, + revocation_behavior: Literal["revoke_previous_secrets_after_h24", "revoke_previous_secrets_immediately"] + | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookRotateSigningSecretResponse: + """ + Generates a new signing secret for a Webhook. + + Args: + revocation_behavior: Optional. The revocation behavior for previous signing secrets. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return self._post( + path_template("/{api_version}/webhooks/{id}:rotateSigningSecret", api_version=api_version, id=id), + body=maybe_transform( + {"revocation_behavior": revocation_behavior}, + webhook_rotate_signing_secret_params.WebhookRotateSigningSecretParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=WebhookRotateSigningSecretResponse, + ) + + +class AsyncWebhooksResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncWebhooksResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/stainless-sdks/gemini-next-gen-api-python#accessing-raw-response-data-eg-headers + """ + return AsyncWebhooksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncWebhooksResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/stainless-sdks/gemini-next-gen-api-python#with_streaming_response + """ + return AsyncWebhooksResourceWithStreamingResponse(self) + + async def create( + self, + *, + api_version: str | None = None, + subscribed_events: List[ + Union[ + Literal[ + "batch.succeeded", + "batch.cancelled", + "batch.expired", + "batch.failed", + "interaction.requires_action", + "interaction.completed", + "interaction.failed", + "interaction.cancelled", + "video.generated", + ], + str, + ] + ], + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookCreateResponse: + """Creates a new Webhook. + + Args: + subscribed_events: + Required. + + The events that the webhook is subscribed to. Available events: + + - batch.succeeded + - batch.cancelled + - batch.expired + - batch.failed + - interaction.requires_action + - interaction.completed + - interaction.failed + - interaction.cancelled + - video.generated + + uri: Required. The URI to which webhook events will be sent. + + 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 + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return await self._post( + path_template("/{api_version}/webhooks", api_version=api_version), + body=await async_maybe_transform( + { + "subscribed_events": subscribed_events, + "uri": uri, + "name": name, + "state": state, + }, + webhook_create_params.WebhookCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + {"webhook_id": webhook_id}, webhook_create_params.WebhookCreateParams + ), + ), + cast_to=WebhookCreateResponse, + ) + + async def retrieve( + self, + id: 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookRetrieveResponse: + """ + Gets a specific Webhook. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return await self._get( + path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=WebhookRetrieveResponse, + ) + + async def update( + self, + id: str, + *, + api_version: str | None = None, + subscribed_events: List[ + Union[ + Literal[ + "batch.succeeded", + "batch.cancelled", + "batch.expired", + "batch.failed", + "interaction.requires_action", + "interaction.completed", + "interaction.failed", + "interaction.cancelled", + "video.generated", + ], + str, + ] + ], + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookUpdateResponse: + """Updates an existing Webhook. + + Args: + subscribed_events: + Required. + + The events that the webhook is subscribed to. Available events: + + - batch.succeeded + - batch.cancelled + - batch.expired + - batch.failed + - interaction.requires_action + - interaction.completed + - interaction.failed + - interaction.cancelled + - video.generated + + uri: Required. The URI to which webhook events will be sent. + + 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 + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return await self._patch( + path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), + body=await async_maybe_transform( + { + "subscribed_events": subscribed_events, + "uri": uri, + "name": name, + "state": state, + }, + webhook_update_params.WebhookUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + {"update_mask": update_mask}, webhook_update_params.WebhookUpdateParams + ), + ), + cast_to=WebhookUpdateResponse, + ) + + async def list( + self, + *, + api_version: str | None = None, + page_size: int | Omit = omit, + page_token: str | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookListResponse: + """Lists all Webhooks. + + Args: + page_size: Optional. + + The maximum number of webhooks to return. The service may return fewer + than this value. If unspecified, at most 50 webhooks will be returned. The + maximum value is 1000. + + page_token: Optional. A page token, received from a previous `ListWebhooks` call. Provide + this to retrieve the subsequent page. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return await self._get( + path_template("/{api_version}/webhooks", api_version=api_version), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "page_size": page_size, + "page_token": page_token, + }, + webhook_list_params.WebhookListParams, + ), + ), + cast_to=WebhookListResponse, + ) + + async def delete( + self, + id: 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookDeleteResponse: + """ + Deletes a Webhook. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return await self._delete( + path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=WebhookDeleteResponse, + ) + + async def ping( + self, + id: str, + *, + api_version: str | None = None, + body: webhook_ping_params.Body | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookPingResponse: + """ + Sends a ping event to a Webhook. + + Args: + body: Request message for WebhookService.PingWebhook. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return await self._post( + path_template("/{api_version}/webhooks/{id}:ping", api_version=api_version, id=id), + 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 + ), + cast_to=WebhookPingResponse, + ) + + async def rotate_signing_secret( + self, + id: str, + *, + api_version: str | None = None, + revocation_behavior: Literal["revoke_previous_secrets_after_h24", "revoke_previous_secrets_immediately"] + | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> WebhookRotateSigningSecretResponse: + """ + Generates a new signing secret for a Webhook. + + Args: + revocation_behavior: Optional. The revocation behavior for previous signing secrets. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if api_version is None: + 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}") + return await self._post( + path_template("/{api_version}/webhooks/{id}:rotateSigningSecret", api_version=api_version, id=id), + body=await async_maybe_transform( + {"revocation_behavior": revocation_behavior}, + webhook_rotate_signing_secret_params.WebhookRotateSigningSecretParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=WebhookRotateSigningSecretResponse, + ) + + +class WebhooksResourceWithRawResponse: + def __init__(self, webhooks: WebhooksResource) -> None: + self._webhooks = webhooks + + self.create = to_raw_response_wrapper( + webhooks.create, + ) + self.retrieve = to_raw_response_wrapper( + webhooks.retrieve, + ) + self.update = to_raw_response_wrapper( + webhooks.update, + ) + self.list = to_raw_response_wrapper( + webhooks.list, + ) + self.delete = to_raw_response_wrapper( + webhooks.delete, + ) + self.ping = to_raw_response_wrapper( + webhooks.ping, + ) + self.rotate_signing_secret = to_raw_response_wrapper( + webhooks.rotate_signing_secret, + ) + + +class AsyncWebhooksResourceWithRawResponse: + def __init__(self, webhooks: AsyncWebhooksResource) -> None: + self._webhooks = webhooks + + self.create = async_to_raw_response_wrapper( + webhooks.create, + ) + self.retrieve = async_to_raw_response_wrapper( + webhooks.retrieve, + ) + self.update = async_to_raw_response_wrapper( + webhooks.update, + ) + self.list = async_to_raw_response_wrapper( + webhooks.list, + ) + self.delete = async_to_raw_response_wrapper( + webhooks.delete, + ) + self.ping = async_to_raw_response_wrapper( + webhooks.ping, + ) + self.rotate_signing_secret = async_to_raw_response_wrapper( + webhooks.rotate_signing_secret, + ) + + +class WebhooksResourceWithStreamingResponse: + def __init__(self, webhooks: WebhooksResource) -> None: + self._webhooks = webhooks + + self.create = to_streamed_response_wrapper( + webhooks.create, + ) + self.retrieve = to_streamed_response_wrapper( + webhooks.retrieve, + ) + self.update = to_streamed_response_wrapper( + webhooks.update, + ) + self.list = to_streamed_response_wrapper( + webhooks.list, + ) + self.delete = to_streamed_response_wrapper( + webhooks.delete, + ) + self.ping = to_streamed_response_wrapper( + webhooks.ping, + ) + self.rotate_signing_secret = to_streamed_response_wrapper( + webhooks.rotate_signing_secret, + ) + + +class AsyncWebhooksResourceWithStreamingResponse: + def __init__(self, webhooks: AsyncWebhooksResource) -> None: + self._webhooks = webhooks + + self.create = async_to_streamed_response_wrapper( + webhooks.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + webhooks.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + webhooks.update, + ) + self.list = async_to_streamed_response_wrapper( + webhooks.list, + ) + self.delete = async_to_streamed_response_wrapper( + webhooks.delete, + ) + self.ping = async_to_streamed_response_wrapper( + webhooks.ping, + ) + self.rotate_signing_secret = async_to_streamed_response_wrapper( + webhooks.rotate_signing_secret, + ) diff --git a/google/genai/_interactions/types/__init__.py b/google/genai/_interactions/types/__init__.py index f3331b0a4..c7dad2ea7 100644 --- a/google/genai/_interactions/types/__init__.py +++ b/google/genai/_interactions/types/__init__.py @@ -46,6 +46,7 @@ from .function_param import FunctionParam as FunctionParam from .place_citation import PlaceCitation as PlaceCitation from .thinking_level import ThinkingLevel as ThinkingLevel +from .webhook_config import WebhookConfig as WebhookConfig from .thought_content import ThoughtContent as ThoughtContent from .annotation_param import AnnotationParam as AnnotationParam from .document_content import DocumentContent as DocumentContent @@ -63,17 +64,27 @@ from .image_content_param import ImageContentParam as ImageContentParam from .speech_config_param import SpeechConfigParam as SpeechConfigParam from .video_content_param import VideoContentParam as VideoContentParam +from .webhook_list_params import WebhookListParams as WebhookListParams +from .webhook_ping_params import WebhookPingParams as WebhookPingParams from .dynamic_agent_config import DynamicAgentConfig as DynamicAgentConfig from .google_search_result import GoogleSearchResult as GoogleSearchResult from .place_citation_param import PlaceCitationParam as PlaceCitationParam +from .webhook_config_param import WebhookConfigParam as WebhookConfigParam from .function_call_content import FunctionCallContent as FunctionCallContent from .interaction_sse_event import InteractionSSEEvent as InteractionSSEEvent from .thought_content_param import ThoughtContentParam as ThoughtContentParam +from .webhook_create_params import WebhookCreateParams as WebhookCreateParams +from .webhook_list_response import WebhookListResponse as WebhookListResponse +from .webhook_ping_response import WebhookPingResponse as WebhookPingResponse +from .webhook_update_params import WebhookUpdateParams as WebhookUpdateParams from .document_content_param import DocumentContentParam as DocumentContentParam from .interaction_get_params import InteractionGetParams as InteractionGetParams from .function_result_content import FunctionResultContent as FunctionResultContent from .generation_config_param import GenerationConfigParam as GenerationConfigParam from .interaction_start_event import InteractionStartEvent as InteractionStartEvent +from .webhook_create_response import WebhookCreateResponse as WebhookCreateResponse +from .webhook_delete_response import WebhookDeleteResponse as WebhookDeleteResponse +from .webhook_update_response import WebhookUpdateResponse as WebhookUpdateResponse from .file_search_call_content import FileSearchCallContent as FileSearchCallContent from .google_maps_call_content import GoogleMapsCallContent as GoogleMapsCallContent from .google_maps_result_param import GoogleMapsResultParam as GoogleMapsResultParam @@ -82,6 +93,7 @@ from .url_context_result_param import URLContextResultParam as URLContextResultParam from .interaction_create_params import InteractionCreateParams as InteractionCreateParams from .interaction_status_update import InteractionStatusUpdate as InteractionStatusUpdate +from .webhook_retrieve_response import WebhookRetrieveResponse as WebhookRetrieveResponse from .deep_research_agent_config import DeepResearchAgentConfig as DeepResearchAgentConfig from .dynamic_agent_config_param import DynamicAgentConfigParam as DynamicAgentConfigParam from .file_search_result_content import FileSearchResultContent as FileSearchResultContent @@ -118,3 +130,7 @@ from .code_execution_call_arguments_param import CodeExecutionCallArgumentsParam as CodeExecutionCallArgumentsParam from .code_execution_result_content_param import CodeExecutionResultContentParam as CodeExecutionResultContentParam from .mcp_server_tool_result_content_param import MCPServerToolResultContentParam as MCPServerToolResultContentParam +from .webhook_rotate_signing_secret_params import WebhookRotateSigningSecretParams as WebhookRotateSigningSecretParams +from .webhook_rotate_signing_secret_response import ( + WebhookRotateSigningSecretResponse as WebhookRotateSigningSecretResponse, +) diff --git a/google/genai/_interactions/types/interaction.py b/google/genai/_interactions/types/interaction.py index 3e94dad97..1beedbde2 100644 --- a/google/genai/_interactions/types/interaction.py +++ b/google/genai/_interactions/types/interaction.py @@ -30,6 +30,7 @@ from .audio_content import AudioContent from .image_content import ImageContent from .video_content import VideoContent +from .webhook_config import WebhookConfig from .thought_content import ThoughtContent from .document_content import DocumentContent from .dynamic_agent_config import DynamicAgentConfig @@ -149,3 +150,10 @@ class Interaction(BaseModel): usage: Optional[Usage] = None """Output only. Statistics on the interaction request's token usage.""" + + webhook_config: Optional[WebhookConfig] = None + """Optional. + + Webhook configuration for receiving notifications when the interaction + completes. + """ diff --git a/google/genai/_interactions/types/interaction_create_params.py b/google/genai/_interactions/types/interaction_create_params.py index a1154741b..61a1f2aa4 100644 --- a/google/genai/_interactions/types/interaction_create_params.py +++ b/google/genai/_interactions/types/interaction_create_params.py @@ -28,6 +28,7 @@ from .audio_content_param import AudioContentParam from .image_content_param import ImageContentParam from .video_content_param import VideoContentParam +from .webhook_config_param import WebhookConfigParam from .thought_content_param import ThoughtContentParam from .document_content_param import DocumentContentParam from .generation_config_param import GenerationConfigParam @@ -102,6 +103,13 @@ class BaseCreateModelInteractionParams(TypedDict, total=False): tools: Iterable[ToolParam] """A list of tool declarations the model may call during interaction.""" + webhook_config: WebhookConfigParam + """Optional. + + Webhook configuration for receiving notifications when the interaction + completes. + """ + Input: TypeAlias = Union[ Iterable[ContentParam], @@ -172,6 +180,13 @@ class BaseCreateAgentInteractionParams(TypedDict, total=False): tools: Iterable[ToolParam] """A list of tool declarations the model may call during interaction.""" + webhook_config: WebhookConfigParam + """Optional. + + Webhook configuration for receiving notifications when the interaction + completes. + """ + AgentConfig: TypeAlias = Union[DynamicAgentConfigParam, DeepResearchAgentConfigParam] diff --git a/google/genai/_interactions/types/webhook_config.py b/google/genai/_interactions/types/webhook_config.py new file mode 100644 index 000000000..b6a16eb7c --- /dev/null +++ b/google/genai/_interactions/types/webhook_config.py @@ -0,0 +1,39 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional + +from .._models import BaseModel + +__all__ = ["WebhookConfig"] + + +class WebhookConfig(BaseModel): + """Message for configuring webhook events for a request.""" + + uris: Optional[List[str]] = None + """Optional. + + If set, these webhook URIs will be used for webhook events instead of the + registered webhooks. + """ + + user_metadata: Optional[Dict[str, object]] = None + """Optional. + + The user metadata that will be returned on each event emission to the webhooks. + """ diff --git a/google/genai/_interactions/types/webhook_config_param.py b/google/genai/_interactions/types/webhook_config_param.py new file mode 100644 index 000000000..c7dd38238 --- /dev/null +++ b/google/genai/_interactions/types/webhook_config_param.py @@ -0,0 +1,42 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import TypedDict + +from .._types import SequenceNotStr + +__all__ = ["WebhookConfigParam"] + + +class WebhookConfigParam(TypedDict, total=False): + """Message for configuring webhook events for a request.""" + + uris: SequenceNotStr[str] + """Optional. + + If set, these webhook URIs will be used for webhook events instead of the + registered webhooks. + """ + + user_metadata: Dict[str, object] + """Optional. + + The user metadata that will be returned on each event emission to the webhooks. + """ diff --git a/google/genai/_interactions/types/webhook_create_params.py b/google/genai/_interactions/types/webhook_create_params.py new file mode 100644 index 000000000..987a494f6 --- /dev/null +++ b/google/genai/_interactions/types/webhook_create_params.py @@ -0,0 +1,74 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["WebhookCreateParams"] + + +class WebhookCreateParams(TypedDict, total=False): + api_version: str + + subscribed_events: Required[ + List[ + Union[ + Literal[ + "batch.succeeded", + "batch.cancelled", + "batch.expired", + "batch.failed", + "interaction.requires_action", + "interaction.completed", + "interaction.failed", + "interaction.cancelled", + "video.generated", + ], + str, + ] + ] + ] + """Required. The events that the webhook is subscribed to. Available events: + + - batch.succeeded + - batch.cancelled + - batch.expired + - batch.failed + - interaction.requires_action + - interaction.completed + - interaction.failed + - interaction.cancelled + - video.generated + """ + + uri: Required[str] + """Required. The URI to which webhook events will be sent.""" + + webhook_id: str + """Optional. + + The webhook_id to use for the webhook. If not specified, the server will + 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_create_response.py b/google/genai/_interactions/types/webhook_create_response.py new file mode 100644 index 000000000..f677e1ff1 --- /dev/null +++ b/google/genai/_interactions/types/webhook_create_response.py @@ -0,0 +1,88 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["WebhookCreateResponse", "SigningSecret"] + + +class SigningSecret(BaseModel): + """Represents a signing secret used to verify webhook payloads.""" + + expire_time: Optional[datetime] = None + """Output only. The expiration date of the signing secret.""" + + truncated_secret: Optional[str] = None + """Output only. The truncated version of the signing secret.""" + + +class WebhookCreateResponse(BaseModel): + """A Webhook resource.""" + + subscribed_events: List[ + Union[ + Literal[ + "batch.succeeded", + "batch.cancelled", + "batch.expired", + "batch.failed", + "interaction.requires_action", + "interaction.completed", + "interaction.failed", + "interaction.cancelled", + "video.generated", + ], + str, + ] + ] + """Required. The events that the webhook is subscribed to. Available events: + + - batch.succeeded + - batch.cancelled + - batch.expired + - batch.failed + - interaction.requires_action + - interaction.completed + - interaction.failed + - interaction.cancelled + - video.generated + """ + + uri: str + """Required. The URI to which webhook events will be sent.""" + + create_time: Optional[datetime] = None + """Output only. The timestamp when the webhook was created.""" + + name: Optional[str] = None + """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.""" + + signing_secrets: Optional[List[SigningSecret]] = None + """Output only. The signing secrets associated with this webhook.""" + + state: Optional[Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"]] = None + """The state of the webhook.""" + + update_time: Optional[datetime] = None + """Output only. The timestamp when the webhook was last updated.""" diff --git a/google/genai/_interactions/types/webhook_delete_response.py b/google/genai/_interactions/types/webhook_delete_response.py new file mode 100644 index 000000000..1d50ba0bd --- /dev/null +++ b/google/genai/_interactions/types/webhook_delete_response.py @@ -0,0 +1,34 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["WebhookDeleteResponse"] + + +class WebhookDeleteResponse(BaseModel): + """ + A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to use it as the request + or the response type of an API method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + } + """ + + pass diff --git a/google/genai/_interactions/types/webhook_list_params.py b/google/genai/_interactions/types/webhook_list_params.py new file mode 100644 index 000000000..aa35c3ee5 --- /dev/null +++ b/google/genai/_interactions/types/webhook_list_params.py @@ -0,0 +1,41 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["WebhookListParams"] + + +class WebhookListParams(TypedDict, total=False): + api_version: str + + page_size: int + """Optional. + + The maximum number of webhooks to return. The service may return fewer than this + value. If unspecified, at most 50 webhooks will be returned. The maximum value + is 1000. + """ + + page_token: str + """Optional. + + A page token, received from a previous `ListWebhooks` call. Provide this to + retrieve the subsequent page. + """ diff --git a/google/genai/_interactions/types/webhook_list_response.py b/google/genai/_interactions/types/webhook_list_response.py new file mode 100644 index 000000000..c52c75fc8 --- /dev/null +++ b/google/genai/_interactions/types/webhook_list_response.py @@ -0,0 +1,101 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["WebhookListResponse", "Webhook", "WebhookSigningSecret"] + + +class WebhookSigningSecret(BaseModel): + """Represents a signing secret used to verify webhook payloads.""" + + expire_time: Optional[datetime] = None + """Output only. The expiration date of the signing secret.""" + + truncated_secret: Optional[str] = None + """Output only. The truncated version of the signing secret.""" + + +class Webhook(BaseModel): + """A Webhook resource.""" + + subscribed_events: List[ + Union[ + Literal[ + "batch.succeeded", + "batch.cancelled", + "batch.expired", + "batch.failed", + "interaction.requires_action", + "interaction.completed", + "interaction.failed", + "interaction.cancelled", + "video.generated", + ], + str, + ] + ] + """Required. The events that the webhook is subscribed to. Available events: + + - batch.succeeded + - batch.cancelled + - batch.expired + - batch.failed + - interaction.requires_action + - interaction.completed + - interaction.failed + - interaction.cancelled + - video.generated + """ + + uri: str + """Required. The URI to which webhook events will be sent.""" + + create_time: Optional[datetime] = None + """Output only. The timestamp when the webhook was created.""" + + name: Optional[str] = None + """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.""" + + signing_secrets: Optional[List[WebhookSigningSecret]] = None + """Output only. The signing secrets associated with this webhook.""" + + state: Optional[Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"]] = None + """The state of the webhook.""" + + update_time: Optional[datetime] = None + """Output only. The timestamp when the webhook was last updated.""" + + +class WebhookListResponse(BaseModel): + """Response message for WebhookService.ListWebhooks.""" + + next_page_token: Optional[str] = None + """ + A token, which can be sent as `page_token` to retrieve the next page. If this + field is omitted, there are no subsequent pages. + """ + + webhooks: Optional[List[Webhook]] = None + """The webhooks.""" diff --git a/google/genai/_interactions/types/webhook_ping_params.py b/google/genai/_interactions/types/webhook_ping_params.py new file mode 100644 index 000000000..30ded197f --- /dev/null +++ b/google/genai/_interactions/types/webhook_ping_params.py @@ -0,0 +1,35 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["WebhookPingParams", "Body"] + + +class WebhookPingParams(TypedDict, total=False): + api_version: str + + body: Body + """Request message for WebhookService.PingWebhook.""" + + +class Body(TypedDict, total=False): + """Request message for WebhookService.PingWebhook.""" + + pass diff --git a/google/genai/_interactions/types/webhook_ping_response.py b/google/genai/_interactions/types/webhook_ping_response.py new file mode 100644 index 000000000..d2f4d474c --- /dev/null +++ b/google/genai/_interactions/types/webhook_ping_response.py @@ -0,0 +1,26 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["WebhookPingResponse"] + + +class WebhookPingResponse(BaseModel): + """Response message for WebhookService.PingWebhook.""" + + pass diff --git a/google/genai/_interactions/types/webhook_retrieve_response.py b/google/genai/_interactions/types/webhook_retrieve_response.py new file mode 100644 index 000000000..a8016498d --- /dev/null +++ b/google/genai/_interactions/types/webhook_retrieve_response.py @@ -0,0 +1,88 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["WebhookRetrieveResponse", "SigningSecret"] + + +class SigningSecret(BaseModel): + """Represents a signing secret used to verify webhook payloads.""" + + expire_time: Optional[datetime] = None + """Output only. The expiration date of the signing secret.""" + + truncated_secret: Optional[str] = None + """Output only. The truncated version of the signing secret.""" + + +class WebhookRetrieveResponse(BaseModel): + """A Webhook resource.""" + + subscribed_events: List[ + Union[ + Literal[ + "batch.succeeded", + "batch.cancelled", + "batch.expired", + "batch.failed", + "interaction.requires_action", + "interaction.completed", + "interaction.failed", + "interaction.cancelled", + "video.generated", + ], + str, + ] + ] + """Required. The events that the webhook is subscribed to. Available events: + + - batch.succeeded + - batch.cancelled + - batch.expired + - batch.failed + - interaction.requires_action + - interaction.completed + - interaction.failed + - interaction.cancelled + - video.generated + """ + + uri: str + """Required. The URI to which webhook events will be sent.""" + + create_time: Optional[datetime] = None + """Output only. The timestamp when the webhook was created.""" + + name: Optional[str] = None + """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.""" + + signing_secrets: Optional[List[SigningSecret]] = None + """Output only. The signing secrets associated with this webhook.""" + + state: Optional[Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"]] = None + """The state of the webhook.""" + + update_time: Optional[datetime] = None + """Output only. The timestamp when the webhook was last updated.""" diff --git a/google/genai/_interactions/types/webhook_rotate_signing_secret_params.py b/google/genai/_interactions/types/webhook_rotate_signing_secret_params.py new file mode 100644 index 000000000..e01940837 --- /dev/null +++ b/google/genai/_interactions/types/webhook_rotate_signing_secret_params.py @@ -0,0 +1,29 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["WebhookRotateSigningSecretParams"] + + +class WebhookRotateSigningSecretParams(TypedDict, total=False): + api_version: str + + revocation_behavior: Literal["revoke_previous_secrets_after_h24", "revoke_previous_secrets_immediately"] + """Optional. The revocation behavior for previous signing secrets.""" diff --git a/google/genai/_interactions/types/webhook_rotate_signing_secret_response.py b/google/genai/_interactions/types/webhook_rotate_signing_secret_response.py new file mode 100644 index 000000000..b8270592e --- /dev/null +++ b/google/genai/_interactions/types/webhook_rotate_signing_secret_response.py @@ -0,0 +1,29 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["WebhookRotateSigningSecretResponse"] + + +class WebhookRotateSigningSecretResponse(BaseModel): + """Response message for WebhookService.RotateSigningSecret.""" + + secret: Optional[str] = None + """Output only. The newly generated signing secret.""" diff --git a/google/genai/_interactions/types/webhook_update_params.py b/google/genai/_interactions/types/webhook_update_params.py new file mode 100644 index 000000000..a0bd8d035 --- /dev/null +++ b/google/genai/_interactions/types/webhook_update_params.py @@ -0,0 +1,70 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["WebhookUpdateParams"] + + +class WebhookUpdateParams(TypedDict, total=False): + api_version: str + + subscribed_events: Required[ + List[ + Union[ + Literal[ + "batch.succeeded", + "batch.cancelled", + "batch.expired", + "batch.failed", + "interaction.requires_action", + "interaction.completed", + "interaction.failed", + "interaction.cancelled", + "video.generated", + ], + str, + ] + ] + ] + """Required. The events that the webhook is subscribed to. Available events: + + - batch.succeeded + - batch.cancelled + - batch.expired + - batch.failed + - interaction.requires_action + - interaction.completed + - interaction.failed + - interaction.cancelled + - video.generated + """ + + uri: Required[str] + """Required. The URI to which webhook events will be sent.""" + + 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.""" diff --git a/google/genai/_interactions/types/webhook_update_response.py b/google/genai/_interactions/types/webhook_update_response.py new file mode 100644 index 000000000..1c4e07928 --- /dev/null +++ b/google/genai/_interactions/types/webhook_update_response.py @@ -0,0 +1,88 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["WebhookUpdateResponse", "SigningSecret"] + + +class SigningSecret(BaseModel): + """Represents a signing secret used to verify webhook payloads.""" + + expire_time: Optional[datetime] = None + """Output only. The expiration date of the signing secret.""" + + truncated_secret: Optional[str] = None + """Output only. The truncated version of the signing secret.""" + + +class WebhookUpdateResponse(BaseModel): + """A Webhook resource.""" + + subscribed_events: List[ + Union[ + Literal[ + "batch.succeeded", + "batch.cancelled", + "batch.expired", + "batch.failed", + "interaction.requires_action", + "interaction.completed", + "interaction.failed", + "interaction.cancelled", + "video.generated", + ], + str, + ] + ] + """Required. The events that the webhook is subscribed to. Available events: + + - batch.succeeded + - batch.cancelled + - batch.expired + - batch.failed + - interaction.requires_action + - interaction.completed + - interaction.failed + - interaction.cancelled + - video.generated + """ + + uri: str + """Required. The URI to which webhook events will be sent.""" + + create_time: Optional[datetime] = None + """Output only. The timestamp when the webhook was created.""" + + name: Optional[str] = None + """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.""" + + signing_secrets: Optional[List[SigningSecret]] = None + """Output only. The signing secrets associated with this webhook.""" + + state: Optional[Literal["enabled", "disabled", "disabled_due_to_failed_deliveries"]] = None + """The state of the webhook.""" + + update_time: Optional[datetime] = None + """Output only. The timestamp when the webhook was last updated."""