Package com.openai.models.responses
Class Tool.CodeInterpreter.Container.CodeInterpreterToolAuto.NetworkPolicy
-
- All Implemented Interfaces:
public final class Tool.CodeInterpreter.Container.CodeInterpreterToolAuto.NetworkPolicyNetwork access policy for the container.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceTool.CodeInterpreter.Container.CodeInterpreterToolAuto.NetworkPolicy.VisitorAn interface that defines how to map each variant of NetworkPolicy to a value of type T.
-
Method Summary
-
-
Method Detail
-
disabled
final Optional<ContainerNetworkPolicyDisabled> disabled()
-
allowlist
final Optional<ContainerNetworkPolicyAllowlist> allowlist()
-
isDisabled
final Boolean isDisabled()
-
isAllowlist
final Boolean isAllowlist()
-
asDisabled
final ContainerNetworkPolicyDisabled asDisabled()
-
asAllowlist
final ContainerNetworkPolicyAllowlist asAllowlist()
-
accept
final <T extends Any> T accept(Tool.CodeInterpreter.Container.CodeInterpreterToolAuto.NetworkPolicy.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = networkPolicy.accept(new NetworkPolicy.Visitor<Optional<String>>() { @Override public Optional<String> visitDisabled(ContainerNetworkPolicyDisabled disabled) { return Optional.of(disabled.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final Tool.CodeInterpreter.Container.CodeInterpreterToolAuto.NetworkPolicy validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofDisabled
final static Tool.CodeInterpreter.Container.CodeInterpreterToolAuto.NetworkPolicy ofDisabled(ContainerNetworkPolicyDisabled disabled)
-
ofAllowlist
final static Tool.CodeInterpreter.Container.CodeInterpreterToolAuto.NetworkPolicy ofAllowlist(ContainerNetworkPolicyAllowlist allowlist)
-
-
-
-