|
48 | 48 | from .types import interactions |
49 | 49 | from .types.security import Security |
50 | 50 | from .utils import BackoffStrategy, RetryConfig, eventstreaming |
| 51 | +from .triggers import AsyncTriggers as GeneratedAsyncTriggers |
| 52 | +from .triggers import Triggers as GeneratedTriggers |
51 | 53 | from .webhooks import AsyncWebhooks as GeneratedAsyncWebhooks |
52 | 54 | from .webhooks import Webhooks as GeneratedWebhooks |
53 | 55 |
|
@@ -667,6 +669,88 @@ async def delete(self, *args: Any, **kwargs: Any) -> Any: |
667 | 669 | return await async_wrap_sdk_call(super().delete, *args, **kwargs) |
668 | 670 |
|
669 | 671 |
|
| 672 | +class GeminiNextGenTriggers(GeneratedTriggers): |
| 673 | + """Public triggers resource backed by the NextGen client. |
| 674 | +
|
| 675 | + Subclasses the generated resource so every public method is wrapped in |
| 676 | + `wrap_sdk_call`, translating per-operation `GenAiError` raises into the |
| 677 | + status-code `APIError` hierarchy exposed at the |
| 678 | + `google.genai._interactions` import surface. |
| 679 | + """ |
| 680 | + |
| 681 | + def __init__(self, api_client: Any): |
| 682 | + sdk = build_google_genai_client(api_client) |
| 683 | + super().__init__(sdk.sdk_configuration, parent_ref=sdk) |
| 684 | + |
| 685 | + if not TYPE_CHECKING: |
| 686 | + @property |
| 687 | + def with_raw_response(self): |
| 688 | + return _RawResponseAccessorProxy(super().with_raw_response) |
| 689 | + |
| 690 | + @property |
| 691 | + def with_streaming_response(self): |
| 692 | + return _RawResponseAccessorProxy(super().with_streaming_response) |
| 693 | + |
| 694 | + def create(self, *args: Any, **kwargs: Any) -> Any: |
| 695 | + return wrap_sdk_call(super().create, *args, **kwargs) |
| 696 | + |
| 697 | + def list(self, *args: Any, **kwargs: Any) -> Any: |
| 698 | + return wrap_sdk_call(super().list, *args, **kwargs) |
| 699 | + |
| 700 | + def get(self, *args: Any, **kwargs: Any) -> Any: |
| 701 | + return wrap_sdk_call(super().get, *args, **kwargs) |
| 702 | + |
| 703 | + def update(self, *args: Any, **kwargs: Any) -> Any: |
| 704 | + return wrap_sdk_call(super().update, *args, **kwargs) |
| 705 | + |
| 706 | + def delete(self, *args: Any, **kwargs: Any) -> Any: |
| 707 | + return wrap_sdk_call(super().delete, *args, **kwargs) |
| 708 | + |
| 709 | + def run(self, *args: Any, **kwargs: Any) -> Any: |
| 710 | + return wrap_sdk_call(super().run, *args, **kwargs) |
| 711 | + |
| 712 | + def list_executions(self, *args: Any, **kwargs: Any) -> Any: |
| 713 | + return wrap_sdk_call(super().list_executions, *args, **kwargs) |
| 714 | + |
| 715 | + |
| 716 | +class AsyncGeminiNextGenTriggers(GeneratedAsyncTriggers): |
| 717 | + """Async public triggers resource backed by the NextGen client.""" |
| 718 | + |
| 719 | + def __init__(self, api_client: Any): |
| 720 | + sdk = build_google_genai_async_client(api_client) |
| 721 | + super().__init__(sdk.sdk_configuration, parent_ref=sdk) |
| 722 | + |
| 723 | + if not TYPE_CHECKING: |
| 724 | + @property |
| 725 | + def with_raw_response(self): |
| 726 | + return _AsyncRawResponseAccessorProxy(super().with_raw_response) |
| 727 | + |
| 728 | + @property |
| 729 | + def with_streaming_response(self): |
| 730 | + return _AsyncRawResponseAccessorProxy(super().with_streaming_response) |
| 731 | + |
| 732 | + async def create(self, *args: Any, **kwargs: Any) -> Any: |
| 733 | + return await async_wrap_sdk_call(super().create, *args, **kwargs) |
| 734 | + |
| 735 | + async def list(self, *args: Any, **kwargs: Any) -> Any: |
| 736 | + return await async_wrap_sdk_call(super().list, *args, **kwargs) |
| 737 | + |
| 738 | + async def get(self, *args: Any, **kwargs: Any) -> Any: |
| 739 | + return await async_wrap_sdk_call(super().get, *args, **kwargs) |
| 740 | + |
| 741 | + async def update(self, *args: Any, **kwargs: Any) -> Any: |
| 742 | + return await async_wrap_sdk_call(super().update, *args, **kwargs) |
| 743 | + |
| 744 | + async def delete(self, *args: Any, **kwargs: Any) -> Any: |
| 745 | + return await async_wrap_sdk_call(super().delete, *args, **kwargs) |
| 746 | + |
| 747 | + async def run(self, *args: Any, **kwargs: Any) -> Any: |
| 748 | + return await async_wrap_sdk_call(super().run, *args, **kwargs) |
| 749 | + |
| 750 | + async def list_executions(self, *args: Any, **kwargs: Any) -> Any: |
| 751 | + return await async_wrap_sdk_call(super().list_executions, *args, **kwargs) |
| 752 | + |
| 753 | + |
670 | 754 | def _add_output_properties_if_interaction(value: Any) -> Any: |
671 | 755 | normalized = _normalize_interaction_shape(value) |
672 | 756 | if normalized is None: |
|
0 commit comments