Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions google/genai/_gaos/types/interactions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from .allowedtools import AllowedTools, AllowedToolsParam
from .allowlistentry import (
AllowlistEntry,
AllowlistEntryMode,
AllowlistEntryParam,
Transform,
TransformParam,
Expand Down Expand Up @@ -451,6 +452,7 @@
"AllowedToolsParam",
"Allowlist",
"AllowlistEntry",
"AllowlistEntryMode",
"AllowlistEntryParam",
"AllowlistParam",
"Annotation",
Expand Down Expand Up @@ -859,6 +861,7 @@
"AllowedTools": ".allowedtools",
"AllowedToolsParam": ".allowedtools",
"AllowlistEntry": ".allowlistentry",
"AllowlistEntryMode": ".allowlistentry",
"AllowlistEntryParam": ".allowlistentry",
"Transform": ".allowlistentry",
"TransformParam": ".allowlistentry",
Expand Down
22 changes: 20 additions & 2 deletions google/genai/_gaos/types/interactions/allowlistentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@
from __future__ import annotations
from .. import BaseModel, UNSET_SENTINEL
from pydantic import model_serializer
from typing import Dict, List, Optional, Union
from typing import Dict, List, Literal, Optional, Union
from typing_extensions import NotRequired, TypeAliasType, TypedDict


AllowlistEntryMode = Literal["disabled",]
r"""Network egress mode. Set via the `\"allowlist\": \"disabled\"` short form;
must be the only rule in the allowlist and cannot be combined with
`domain`, `transform` or `credential`.
"""


TransformParam = TypeAliasType(
"TransformParam", Union[List[Dict[str, str]], Dict[str, str]]
)
Expand All @@ -43,6 +50,11 @@ class AllowlistEntryParam(TypedDict):
"""
credential: NotRequired[str]
r"""Optional. Reference to a server-managed Credential resource by ID."""
mode: NotRequired[AllowlistEntryMode]
r"""Network egress mode. Set via the `\"allowlist\": \"disabled\"` short form;
must be the only rule in the allowlist and cannot be combined with
`domain`, `transform` or `credential`.
"""
transform: NotRequired[TransformParam]
r"""Headers to inject on all outbound requests matching this domain. Accepts a single dict or a list of dicts. The egress proxy injects these automatically."""

Expand All @@ -58,12 +70,18 @@ class AllowlistEntry(BaseModel):
credential: Optional[str] = None
r"""Optional. Reference to a server-managed Credential resource by ID."""

mode: Optional[AllowlistEntryMode] = None
r"""Network egress mode. Set via the `\"allowlist\": \"disabled\"` short form;
must be the only rule in the allowlist and cannot be combined with
`domain`, `transform` or `credential`.
"""

transform: Optional[Transform] = None
r"""Headers to inject on all outbound requests matching this domain. Accepts a single dict or a list of dicts. The egress proxy injects these automatically."""

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["credential", "transform"])
optional_fields = set(["credential", "mode", "transform"])
serialized = handler(self)
m = {}

Expand Down
Loading