Package com.openai.models.beta.responses
Class BetaContainerAuto.NetworkPolicy
-
- All Implemented Interfaces:
public final class BetaContainerAuto.NetworkPolicyNetwork access policy for the container.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaContainerAuto.NetworkPolicy.VisitorAn interface that defines how to map each variant of NetworkPolicy to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaContainerNetworkPolicyDisabled>disabled()final Optional<BetaContainerNetworkPolicyAllowlist>allowlist()final BooleanisDisabled()final BooleanisAllowlist()final BetaContainerNetworkPolicyDisabledasDisabled()final BetaContainerNetworkPolicyAllowlistasAllowlist()final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaContainerAuto.NetworkPolicy.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaContainerAuto.NetworkPolicyvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaContainerAuto.NetworkPolicyofDisabled(BetaContainerNetworkPolicyDisabled disabled)final static BetaContainerAuto.NetworkPolicyofAllowlist(BetaContainerNetworkPolicyAllowlist allowlist)-
-
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(BetaContainerAuto.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 BetaContainerAuto.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 BetaContainerAuto.NetworkPolicy ofDisabled(BetaContainerNetworkPolicyDisabled disabled)
-
ofAllowlist
final static BetaContainerAuto.NetworkPolicy ofAllowlist(BetaContainerNetworkPolicyAllowlist allowlist)
-
-
-
-