Package com.openai.models.beta.responses
Class BetaTool.CodeInterpreter.Container.CodeInterpreterToolAuto.NetworkPolicy
-
- All Implemented Interfaces:
public final class BetaTool.CodeInterpreter.Container.CodeInterpreterToolAuto.NetworkPolicyNetwork access policy for the container.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaTool.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<BetaContainerNetworkPolicyDisabled> disabled()
-
allowlist
final Optional<BetaContainerNetworkPolicyAllowlist> allowlist()
-
isDisabled
final Boolean isDisabled()
-
isAllowlist
final Boolean isAllowlist()
-
asDisabled
final BetaContainerNetworkPolicyDisabled asDisabled()
-
asAllowlist
final BetaContainerNetworkPolicyAllowlist asAllowlist()
-
accept
final <T extends Any> T accept(BetaTool.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(BetaContainerNetworkPolicyDisabled disabled) { return Optional.of(disabled.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaTool.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 BetaTool.CodeInterpreter.Container.CodeInterpreterToolAuto.NetworkPolicy ofDisabled(BetaContainerNetworkPolicyDisabled disabled)
-
ofAllowlist
final static BetaTool.CodeInterpreter.Container.CodeInterpreterToolAuto.NetworkPolicy ofAllowlist(BetaContainerNetworkPolicyAllowlist allowlist)
-
-
-
-