Package com.openai.models.responses
Class ResponseInputItem.ShellCall.Environment
-
- All Implemented Interfaces:
public final class ResponseInputItem.ShellCall.EnvironmentThe environment to execute the shell commands in.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceResponseInputItem.ShellCall.Environment.VisitorAn interface that defines how to map each variant of Environment to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<LocalEnvironment>local()final Optional<ContainerReference>containerReference()final BooleanisLocal()final BooleanisContainerReference()final LocalEnvironmentasLocal()final ContainerReferenceasContainerReference()final Optional<JsonValue>_json()final <T extends Any> Taccept(ResponseInputItem.ShellCall.Environment.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ResponseInputItem.ShellCall.Environmentvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ResponseInputItem.ShellCall.EnvironmentofLocal(LocalEnvironment local)final static ResponseInputItem.ShellCall.EnvironmentofContainerReference(ContainerReference containerReference)-
-
Method Detail
-
local
final Optional<LocalEnvironment> local()
-
containerReference
final Optional<ContainerReference> containerReference()
-
isContainerReference
final Boolean isContainerReference()
-
asLocal
final LocalEnvironment asLocal()
-
asContainerReference
final ContainerReference asContainerReference()
-
accept
final <T extends Any> T accept(ResponseInputItem.ShellCall.Environment.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 = environment.accept(new Environment.Visitor<Optional<String>>() { @Override public Optional<String> visitLocal(LocalEnvironment local) { return Optional.of(local.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ResponseInputItem.ShellCall.Environment 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.
-
ofLocal
final static ResponseInputItem.ShellCall.Environment ofLocal(LocalEnvironment local)
-
ofContainerReference
final static ResponseInputItem.ShellCall.Environment ofContainerReference(ContainerReference containerReference)
-
-
-
-