From eb754a9dbac6ca57cd655413664d0a1d9c1d8b3b Mon Sep 17 00:00:00 2001 From: Wanlin Du Date: Wed, 23 Sep 2026 14:15:00 -0700 Subject: [PATCH] chore: expose GenAI domain types (environments, triggers, webhooks, agents) in dedicated submodules PiperOrigin-RevId: 986998498 --- google/genai/__init__.py | 21 ++++++++- google/genai/agents.py | 55 ++++++++++++++++++++++++ google/genai/credentials.py | 62 +++++++++++++++++++++++++-- google/genai/environments.py | 71 ++++++++++++++++++++++++++++++ google/genai/triggers.py | 77 +++++++++++++++++++++++++++++++++ google/genai/webhooks.py | 83 ++++++++++++++++++++++++++++++++++++ 6 files changed, 363 insertions(+), 6 deletions(-) create mode 100644 google/genai/agents.py create mode 100644 google/genai/environments.py create mode 100644 google/genai/triggers.py create mode 100644 google/genai/webhooks.py diff --git a/google/genai/__init__.py b/google/genai/__init__.py index bb88348a7..e82c8192d 100644 --- a/google/genai/__init__.py +++ b/google/genai/__init__.py @@ -25,11 +25,28 @@ __version__ = version.__version__ -__all__ = ['Client', 'credentials', 'interactions', 'types', 'voices'] +__all__ = [ + 'Client', + 'agents', + 'credentials', + 'environments', + 'interactions', + 'triggers', + 'types', + 'voices', + 'webhooks', +] def __getattr__(name: str) -> Any: - if name in ('credentials', 'interactions', 'voices'): + if name in { + 'agents', + 'credentials', + 'environments', + 'interactions', + 'triggers', + 'webhooks', + }: module = importlib.import_module(f'.{name}', __name__) globals()[name] = module return module diff --git a/google/genai/agents.py b/google/genai/agents.py new file mode 100644 index 000000000..fd1466f16 --- /dev/null +++ b/google/genai/agents.py @@ -0,0 +1,55 @@ +# Copyright 2026 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. +# +"""Expose Google GenAI agent types.""" + +from ._gaos.models.createagent import ( + CreateAgentRequestParam, +) +from ._gaos.models.listagents import ( + ListAgentsRequestParam as AgentListParams, +) +from ._gaos.types.agents.agent import ( + Agent, + AgentConfig, + AgentConfigParam, + AgentParam, + AgentParam as AgentCreateParams, + BaseEnvironment, + BaseEnvironmentParam, +) +from ._gaos.types.agents.agentlistresponse import ( + AgentListResponse, +) +from ._gaos.types.agents.agenttool import ( + AgentTool, + AgentToolParam, +) +from ._gaos.types.interactions.empty import Empty as AgentDeleteResponse + +__all__ = [ + "Agent", + "AgentConfig", + "AgentConfigParam", + "AgentCreateParams", + "AgentDeleteResponse", + "AgentListParams", + "AgentListResponse", + "AgentParam", + "AgentTool", + "AgentToolParam", + "BaseEnvironment", + "BaseEnvironmentParam", + "CreateAgentRequestParam", +] diff --git a/google/genai/credentials.py b/google/genai/credentials.py index f6e1dd693..6a1640200 100644 --- a/google/genai/credentials.py +++ b/google/genai/credentials.py @@ -1,4 +1,4 @@ -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,11 +14,48 @@ # """Expose Google GenAI credential types.""" -from ._gaos.models.listcredentials import ListCredentialsRequestParam as CredentialListParams +from ._gaos.models.listcredentials import ( + ListCredentialsRequestParam as CredentialListParams, +) from ._gaos.types.credentials.credential import Credential from ._gaos.types.credentials.credentialcreateparams import CredentialCreateParams -from ._gaos.types.credentials.credentiallistresponse import CredentialListResponse -from ._gaos.types.credentials.credentialupdate import CredentialUpdateParam as CredentialUpdateParams +from ._gaos.types.credentials.credentiallistresponse import ( + CredentialListResponse, +) +from ._gaos.types.credentials.credentialupdate import ( + CredentialUpdateParam as CredentialUpdateParams, +) +from ._gaos.types.credentials.environmentvariableconfig import ( + EnvironmentVariableConfig, + EnvironmentVariableConfigInjectionLocation, + EnvironmentVariableConfigInjectionLocationParam, + EnvironmentVariableConfigParam, +) +from ._gaos.types.credentials.environmentvariableupdateconfig import ( + EnvironmentVariableUpdateConfig, + EnvironmentVariableUpdateConfigInjectionLocation, + EnvironmentVariableUpdateConfigInjectionLocationParam, + EnvironmentVariableUpdateConfigParam, +) +from ._gaos.types.credentials.httpbearerconfig import ( + HTTPBearerConfig, + HTTPBearerConfigParam, +) +from ._gaos.types.credentials.httpbearerupdateconfig import ( + HTTPBearerUpdateConfig, + HTTPBearerUpdateConfigParam, +) +from ._gaos.types.credentials.injectionlocation_enum import ( + InjectionLocationEnum, +) +from ._gaos.types.credentials.oauth2config import ( + OAuth2Config, + OAuth2ConfigParam, +) +from ._gaos.types.credentials.oauth2updateconfig import ( + OAuth2UpdateConfig, + OAuth2UpdateConfigParam, +) from ._gaos.types.interactions.empty import Empty as CredentialDeleteResponse __all__ = [ @@ -28,4 +65,21 @@ "CredentialListParams", "CredentialListResponse", "CredentialUpdateParams", + "EnvironmentVariableConfig", + "EnvironmentVariableConfigInjectionLocation", + "EnvironmentVariableConfigInjectionLocationParam", + "EnvironmentVariableConfigParam", + "EnvironmentVariableUpdateConfig", + "EnvironmentVariableUpdateConfigInjectionLocation", + "EnvironmentVariableUpdateConfigInjectionLocationParam", + "EnvironmentVariableUpdateConfigParam", + "HTTPBearerConfig", + "HTTPBearerConfigParam", + "HTTPBearerUpdateConfig", + "HTTPBearerUpdateConfigParam", + "InjectionLocationEnum", + "OAuth2Config", + "OAuth2ConfigParam", + "OAuth2UpdateConfig", + "OAuth2UpdateConfigParam", ] diff --git a/google/genai/environments.py b/google/genai/environments.py new file mode 100644 index 000000000..95358d16f --- /dev/null +++ b/google/genai/environments.py @@ -0,0 +1,71 @@ +# Copyright 2026 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. +# +"""Expose Google GenAI environment types.""" + +from ._gaos.models.listenvironments import ( + ListEnvironmentsRequestParam as EnvironmentListParams, +) +from ._gaos.types.environments.createenvironmentrequest import ( + CreateEnvironmentRequest, + CreateEnvironmentRequestNetworkEnum, + CreateEnvironmentRequestNetworkUnion, + CreateEnvironmentRequestNetworkUnionParam, + CreateEnvironmentRequestParam, + CreateEnvironmentRequestParam as EnvironmentCreateParams, +) +from ._gaos.types.environments.environment import ( + Environment, + EnvironmentNetworkEnum, + EnvironmentNetworkUnion, + EnvironmentNetworkUnionTypedDict, + Status, + Status as EnvironmentStatus, +) +from ._gaos.types.environments.environmentfile import ( + EnvironmentFile, + Type, + Type as EnvironmentFileType, +) +from ._gaos.types.environments.getenvironmentfilesresponse import ( + GetEnvironmentFilesResponse, +) +from ._gaos.types.environments.listenvironmentsresponse import ( + ListEnvironmentsResponse, + ListEnvironmentsResponse as EnvironmentListResponse, +) +from ._gaos.types.interactions.empty import Empty as EnvironmentDeleteResponse + +__all__ = [ + "CreateEnvironmentRequest", + "CreateEnvironmentRequestNetworkEnum", + "CreateEnvironmentRequestNetworkUnion", + "CreateEnvironmentRequestNetworkUnionParam", + "CreateEnvironmentRequestParam", + "Environment", + "EnvironmentCreateParams", + "EnvironmentDeleteResponse", + "EnvironmentFile", + "EnvironmentFileType", + "EnvironmentListParams", + "EnvironmentListResponse", + "EnvironmentNetworkEnum", + "EnvironmentNetworkUnion", + "EnvironmentNetworkUnionTypedDict", + "EnvironmentStatus", + "GetEnvironmentFilesResponse", + "ListEnvironmentsResponse", + "Status", + "Type", +] diff --git a/google/genai/triggers.py b/google/genai/triggers.py new file mode 100644 index 000000000..8e28e43cb --- /dev/null +++ b/google/genai/triggers.py @@ -0,0 +1,77 @@ +# Copyright 2026 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. +# +"""Expose Google GenAI trigger types.""" + +from ._gaos.models.listtriggerexecutions import ( + ListTriggerExecutionsRequestParam as TriggerListExecutionsParams, +) +from ._gaos.models.listtriggers import ( + ListTriggersRequestParam as TriggerListParams, +) +from ._gaos.models.updatetrigger import ( + UpdateTriggerRequestParam, +) +from ._gaos.types.interactions.empty import Empty as TriggerDeleteResponse +from ._gaos.types.triggers.listtriggerexecutionsresponse import ( + ListTriggerExecutionsResponse, + ListTriggerExecutionsResponse as TriggerListExecutionsResponse, +) +from ._gaos.types.triggers.listtriggersresponse import ( + ListTriggersResponse, + ListTriggersResponse as TriggerListResponse, +) +from ._gaos.types.triggers.trigger import ( + Trigger, + TriggerStatus, +) +from ._gaos.types.triggers.triggercreateparams import ( + Interaction, + InteractionParam, + TriggerCreateParams, + TriggerCreateParamsParam, +) +from ._gaos.types.triggers.triggerexecution import ( + TriggerExecution, + TriggerExecutionStatus, +) +from ._gaos.types.triggers.triggerupdate import ( + TriggerUpdate, + TriggerUpdateParam, + TriggerUpdateParam as TriggerUpdateParams, + TriggerUpdateStatus, +) + +__all__ = [ + "Interaction", + "InteractionParam", + "ListTriggerExecutionsResponse", + "ListTriggersResponse", + "Trigger", + "TriggerCreateParams", + "TriggerCreateParamsParam", + "TriggerDeleteResponse", + "TriggerExecution", + "TriggerExecutionStatus", + "TriggerListExecutionsParams", + "TriggerListExecutionsResponse", + "TriggerListParams", + "TriggerListResponse", + "TriggerStatus", + "TriggerUpdate", + "TriggerUpdateParam", + "TriggerUpdateParams", + "TriggerUpdateStatus", + "UpdateTriggerRequestParam", +] diff --git a/google/genai/webhooks.py b/google/genai/webhooks.py new file mode 100644 index 000000000..9afbd59c7 --- /dev/null +++ b/google/genai/webhooks.py @@ -0,0 +1,83 @@ +# Copyright 2026 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. +# +"""Expose Google GenAI webhook types.""" + +from ._gaos.models.createwebhook import ( + CreateWebhookRequestParam, +) +from ._gaos.models.listwebhooks import ( + ListWebhooksRequestParam as WebhookListParams, +) +from ._gaos.types.interactions.empty import Empty as WebhookDeleteResponse +from ._gaos.types.webhooks.pingwebhookrequest import ( + PingWebhookRequest, + PingWebhookRequestParam, + PingWebhookRequestParam as WebhookPingParams, +) +from ._gaos.types.webhooks.rotatesigningsecretrequest import ( + RevocationBehavior, + RotateSigningSecretRequest, + RotateSigningSecretRequestParam, + RotateSigningSecretRequestParam as WebhookRotateSigningSecretParams, +) +from ._gaos.types.webhooks.signingsecret import SigningSecret +from ._gaos.types.webhooks.webhook import ( + Webhook, + WebhookInput, + WebhookInputParam, + WebhookInputParam as WebhookCreateParams, + WebhookState, + WebhookSubscribedEvent, +) +from ._gaos.types.webhooks.webhooklistresponse import WebhookListResponse +from ._gaos.types.webhooks.webhookpingresponse import WebhookPingResponse +from ._gaos.types.webhooks.webhookrotatesigningsecretresponse import ( + WebhookRotateSigningSecretResponse, +) +from ._gaos.types.webhooks.webhookupdate import ( + WebhookUpdate, + WebhookUpdateParam, + WebhookUpdateParam as WebhookUpdateParams, + WebhookUpdateState, + WebhookUpdateSubscribedEvent, +) + +__all__ = [ + "CreateWebhookRequestParam", + "PingWebhookRequest", + "PingWebhookRequestParam", + "RevocationBehavior", + "RotateSigningSecretRequest", + "RotateSigningSecretRequestParam", + "SigningSecret", + "Webhook", + "WebhookCreateParams", + "WebhookDeleteResponse", + "WebhookInput", + "WebhookInputParam", + "WebhookListParams", + "WebhookListResponse", + "WebhookPingParams", + "WebhookPingResponse", + "WebhookRotateSigningSecretParams", + "WebhookRotateSigningSecretResponse", + "WebhookState", + "WebhookSubscribedEvent", + "WebhookUpdate", + "WebhookUpdateParam", + "WebhookUpdateParams", + "WebhookUpdateState", + "WebhookUpdateSubscribedEvent", +]